date output doesn't get default error meta text. Also this has been mentioned in Bugs section I already have a large number of pre-written scripts and trying to capture print STDERR from them, not the system generated error signals alone. So I would like to perform similar callback function for STDERR as well. Thanksuse IO::Callback; # Here's the coderef my $code = sub { my $str = shift; print STDERR "This is really bad: $str"; }; # Turn it into a filehandle opened in write mode my $fh = IO::Callback->new('>', $code); # Select that filehandle (makes it the default for print, say, etc). select($fh); # Print something - it gets passed to the coderef! print "Hello World\n"; system("date");
In reply to Re^4: Syncing perltie filehandle STDOUT STDERR and system call
by karthikm897
in thread Syncing perltie filehandle STDOUT STDERR and system call
by karthikm897
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |