Re: patch full of dark magic

Alexandr Ciornii <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
Hello

I think, I did a  workaround for real issue - exit does not always
behave correctly on Windows in DESTROY in child after fork.
If you look into patch idea, you will see that I just added one line
"fail "Child should be inactive on DESTROY";". IMHO, this could not
result in false PASS :). And in false FAIL too - fail is done in the
same case as original code should fail.

2010/8/7 Jan Dubois <[email protected]>:
> On Fri, 06 Aug 2010, Alexandr Ciornii wrote:

> However, I'm always suspicious when I see code like this:
>
>    if ($^O =~ /win/i) { #Win32 dark magic. It works, so don't change anything
>
> It isn't clear if that branch should be executed for Cygwin or not (currently
> it will, although the comment sounds like it shouldn't, given that Cygwin is
> considered to be a separate platform from Win32).  I prefer to always make things
> explicit, either
>
>    if ($^O eq "MSWin32" || $^O eq "cygwin") {
>
> or
>
>    if ($^O eq "MSWin32") {
>
> Of course the "It works, so don't change anything" comment is another alarming
> red flag: you should not make changes to code if you don't understand what the
> changes are doing and/or if you can't explain why it does what it does.  Just
> because you are getting rid of a symptom doesn't mean you solved the real issue.
>
> I think it would be better to either SKIP or TODO a test instead of cargo-culting
> a work-around that cannot be explained.
>
> Cheers,
> -Jan
>
>



-- 
Alexandr Ciornii, http://chorny.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.