First of all this cannot be your exact code because it doesn't even compile.That aside:
$logFile is a file handle. when it is interoplated into a string it will become something like "GLOB(0x810388c)". What you need to do is either: make $logFile contain the name of the file to which you wish output to be directed, or execute the command using backticks (`command >> logfile`) and capture the return value and print it to your filehandle.
my $output = `command`; print $logFile $output; # or my $logFile = "path/to/loge/file"; system("command >> $logFile");
Does that make sense?
A truely compassionate attitude towards other does not change, even if they behave negatively or hurt you
His Holiness, The Dalai Lama
In reply to Re: Piping output into a log file
by JediWizard
in thread Piping output into a log file
by CC Em
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |