| Server IP : 108.167.183.253 / Your IP : 216.73.216.79 Web Server : Apache System : Linux gator4209.hostgator.com 5.14.0-687.39.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Aug 18 06:09:16 EDT 2026 x86_64 User : raghunath ( 2558) PHP Version : 8.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/perl-Capture-Tiny/examples/ |
Upload File : |
use Capture::Tiny qw[ capture ];
my ( $out, $err ) =
eval { capture { print STDERR "hello\n"; print STDOUT "there\n"; die("foo\n" ) } };
print STDERR "STDERR:\nout=$out\nerr=$err\n\$@=$@";
print STDOUT "STDOUT:\nout=$out\nerr=$err\n\$@=$@";
open FILE, '>ttt.log' or die( "error opening logfile\n" );
print FILE "FILE:\nout=$out\nerr=$err\n\$@=$@\n";
close FILE;