Created
April 26, 2019 14:25
-
-
Save SqrtNegInf/291f0d3de8f60bdb9c7a873a4d14dd56 to your computer and use it in GitHub Desktop.
File handle (given as suffix) ignored without warning
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
say 'stdout:'; | |
say(1); | |
say 2; | |
3.say; | |
say ''; | |
say '"b" should not be here:'; | |
my $out = open('test.txt', :w); | |
$out.say: 'a'; | |
'b'.say(:$out); # <====== | |
$out.say('c'); | |
close $out; | |
say ''; | |
say 'lines in file:'; | |
run('wc', '-l', 'test.txt'); | |
say 'content of file:'; | |
run('cat', 'test.txt'); | |
print "\n"; | |
#`{{ | |
output of the above: | |
stdout: | |
1 | |
2 | |
3 | |
"b" should not be here: | |
b | |
lines in file: | |
2 test.txt | |
content of file: | |
a | |
c | |
}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment