jptxs has asked for the wisdom of the Perl Monks concerning the following question:
this:
close STDOUT; close STDERR; open ( FILE, ">>./testing.stdout" ) or die "$!\n\n"; print FILE "this\n"; system('ls') == 0 or print FILE "oops $!\n"; print "that\n";
results in:
this DBVARS.main getServername.pl logs nssswitch.pl nssswitch.sh testing.stdout tryCloseSDTOUT.pl
I get why "that\n" doesn't print, but why does the system output appear in my file? Apparently, it's because it has nowhere else to go. My usual methods of investigation have turned up dry...
We speak the way we breathe. --Fugazi
|
---|
Replies are listed 'Best First'. | |
---|---|
•Re: close STDOUT and system equal strange?
by merlyn (Sage) on Feb 21, 2004 at 23:22 UTC | |
by jptxs (Curate) on Feb 22, 2004 at 01:10 UTC | |
by Anonymous Monk on Feb 22, 2004 at 08:54 UTC |
Back to
Seekers of Perl Wisdom