RosettaCodeData/Task/Execute-a-system-command/Perl/execute-a-system-command.pl
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

13 lines
311 B
Perl

my @results = qx(ls);
# runs command and returns its STDOUT as a string
my @results = `ls`;
# ditto, alternative syntax
system "ls";
# runs command and returns its exit status; its STDOUT gets output to our STDOUT
print `ls`;
#The same, but with back quotes
exec "ls";
# replace current process with another