On unix, the output is as expected:-> more bug* :::::::::::::: bugSTDOUT.pl :::::::::::::: #!/usr/bin/perl print STDOUT "Running bugSTDOUTb.pl with backticks\n"; print STDOUT "stdout from bugSTDOUTb.pl=" . `bugSTDOUTb.pl` . "\n"; :::::::::::::: bugSTDOUTb.pl :::::::::::::: #!/usr/bin/perl print STDOUT "Running bugSTDOUTc.pl with system()\n"; system('bugSTDOUTc.pl'); print STDOUT "$0 done\n"; :::::::::::::: bugSTDOUTc.pl :::::::::::::: #!/usr/bin/perl print STDOUT "Hello world!\n";
But on windows, the STDOUT from the 3rd script is missing:-> bugSTDOUT.pl Running bugSTDOUTb.pl with backticks stdout from bugSTDOUTb.pl=Running bugSTDOUTc.pl with system() Hello world! /u/geaaron/bin/bugSTDOUTb.pl done
Where did the STDOUT go? Is there a solution to this problem? I really need windows to do the same thing unix does...D:\My\Tools>bugSTDOUT.pl Running bugSTDOUTb.pl with backticks stdout from bugSTDOUTb.pl=Running bugSTDOUTc.pl with system() D:\My\Tools\bugSTDOUTb.pl done
NOTE: This does not happen for STDERR. If you s/STDOUT/STDERR/g things work as expected on both platforms.
Thanks, Aaron
In reply to STDOUT missing on Windows, works on Unix by abecher
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |