RosettaCodeData/Task/Execute-a-system-command/Perl-6/execute-a-system-command.pl6

7 lines
150 B
Raku

run "ls" orelse .die; # output to stdout
my @ls = qx/ls/; # output to variable
my $cmd = 'ls';
@ls = qqx/$cmd/; # same thing with interpolation