-
-
Save AlexDaniel/fca7b261d6a4e46290d2fdb7645e5e2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
my $filename = 'sandbox/null-program.p6'; | |
my $fh = open $filename, :w; | |
END { unlink $filename } | |
$fh.put: 「 | |
$*ERR.say( Q/This goes to standard error/ ); | |
$*OUT.say( Q/This goes to standard output/ ); | |
exit 137; | |
」; | |
{ | |
my $proc = run $*EXECUTABLE, $filename; | |
say "1. Exit is { $proc.exitcode }"; | |
} | |
{ | |
my $proc = run $*EXECUTABLE, $filename, :out; | |
$proc.out.slurp-rest( :close ); | |
say "2. Exit is { $proc.exitcode }"; | |
} | |
{ | |
my $proc = run $*EXECUTABLE, $filename, :err; | |
$proc.err.slurp-rest( :close ); | |
say "3. Exit is { $proc.exitcode }"; | |
} | |
{ | |
my $proc = run $*EXECUTABLE, $filename, :out, :err; | |
$proc.out.slurp-rest( :close ); | |
$proc.err.slurp-rest( :close ); | |
say "4. Exit is { $proc.exitcode }"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment