~/src/perl6/sandbox/yes | head
y
y
y
y
y
y
y
y
y
y
Failed to write bytes to filehandle: Broken pipe
in sub MAIN at /home/trey/src/perl6/sandbox/yes line 3
in block <unit> at /home/trey/src/perl6/sandbox/yes line 1
Unhandled exception: Failed to write bytes to filehandle: Broken pipe
at SETTING::src/core/Exception.pm6:485 (/home/trey/perl6/rakudo-star/rakudo-star-2019.03/install/share/perl6/runtime/CORE.setting.moarvm:<anon>)
from gen/moar/stage2/NQPHLL.nqp:1854 (/home/trey/perl6/rakudo-star/rakudo-star-2019.03/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
from src/Perl6/Compiler.nqp:38 (/home/trey/perl6/rakudo-star/rakudo-star-2019.03/install/share/nqp/lib/Perl6/Compiler.moarvm:command_eval)
from gen/moar/stage2/NQPHLL.nqp:1773 (/home/trey/perl6/rakudo-star/rakudo-star-2019.03/install/share/nqp/lib/NQPHLL.moarvm:command_line)
from gen/moar/main.nqp:48 (/home/trey/perl6/rakudo-star/rakudo-star-2019.03/install/share/perl6/runtime/perl6.moarvm:MAIN)
from gen/moar/main.nqp:1 (/home/trey/perl6/rakudo-star/rakudo-star-2019.03/install/share/perl6/runtime/perl6.moarvm:<mainline>)
from <unknown>:1 (/home/trey/perl6/rakudo-star/rakudo-star-2019.03/install/share/perl6/runtime/perl6.moarvm:<main>)
from <unknown>:1 (/home/trey/perl6/rakudo-star/rakudo-star-2019.03/install/share/perl6/runtime/perl6.moarvm:<entry>)
Last active
June 20, 2019 21:06
-
-
Save treyharris/489a71a643511895ac272e963eecc973 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/bin/env perl6 | |
| sub MAIN(Str $output="y") { | |
| loop { | |
| say $output; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't even work:
It seems that something outside of our control is printing that final line.
(Even if you redirect
$*ERRsomewhere else, it still gets printed toSTDERR.)A work-around is to also close
$*ERR.(Rakudo can't print anything to
STDERRif it is already closed.)(Without checking, I would guess that this returns an exitcode of 1.)