my $output = qx{ls}; ( open my $file, '>', 'filename' ) or die "Cannot open file 'filename' + for writing: $!\n"; print $file $output; close $file or die "Error writing to file 'filename': $!\n";
See perlop for information about qx and other quote-like operators.
In reply to Re: How to send the Output from system command into a file
by mr_mischief
in thread How to send the Output from system command into a file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |