http://qs321.pair.com?node_id=330861

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