Skip to content

Instantly share code, notes, and snippets.

@SqrtNegInf
Created April 26, 2019 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SqrtNegInf/291f0d3de8f60bdb9c7a873a4d14dd56 to your computer and use it in GitHub Desktop.
Save SqrtNegInf/291f0d3de8f60bdb9c7a873a4d14dd56 to your computer and use it in GitHub Desktop.
File handle (given as suffix) ignored without warning
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