use warnings; use strict; use Mail::Sender; use IO::Scalar; my $output; my $date = '31Jul200'; my $logfile = "d:\\log\\$date.log"; my $elogfile = "d:\\log\\exported\\$date.elog"; tie (*STDOUT, 'IO::Scalar', \$output); # Use this to capture STDOUT my $cmd = `fw logexport -i $logfile -o $elogfile -r 1000 -n`; untie *STDOUT; # Use this to return STDOUT to normal print "my output='$output'"