in reply to Re: warning: perl bug in 5.6.x, Win32 (use warnings and STDERR)
in thread warning: perl bug in 5.6.x, Win32 (use warnings and STDERR)
I tried to play with this a little more. It only prints the first line even if you remove the use warnings and run the script with perl -w or if you set the $^W.
close(STDERR); open(ME, "$0"); $^W=1; while (<ME>) { print; } close ME;
It fails even if you put the $^W=1; inside the loop, but you always have to close the STDERR before opening the file.
Jenda
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
-- Rick Osborne
|
---|