in reply to terminal control in MS
Which will redirect your STDERR to a log file when you double click on the short-cut.C:\Perl\bin\Perl.exe C:\Perl-examples\example.pl 2> C:\Perl-examples\e +xample.log
use IO::Capture::Stderr; my $capture = IO::Capture::Stderr->new(); $capture->start(); # start captured # your stuff here... print STDERR "...\n"; # STDERR is captured print "...\n"; # STDOUT is not captured # at the end $capture->stop(); # stop capture my @err = $capture->read; if ($#err >= 0) { # any captured error? print "$_" for @err; # print stderr to screen <STDIN>; # wait for input }
|
|---|