RosettaCodeData/Task/Get-system-command-output/Perl/get-system-command-output-2.pl

3 lines
131 B
Perl
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
my $command = shift or die "No command supplied\n";
my @output_and_errors = qx/$command 2>&1/ or die "Couldn't execute command\n";