On Tue, 04 Jul 2017 22:20:58 -0700, samant...@posteo.net wrote:
> Here is the offending code
> https://gist.github.com/9ed8322b4c9e1a40e1f3df495d8cee1d (not written
> by
> me).
> 
> If you run it normally with no arguments and just press enter till the
> end of execution, there are no issues. If you run `perl6 deckofpain.p6
> easy` at the end of execution you get
> 
> 
> Failed to open file /home/samantha/proj/perl6/easy: No such file or
> directory
>   in sub MAIN at deck-of-pain.p6 line 127
>   in block <unit> at deck-of-pain.p6 line 30
> 
> 
> This is the commit that introduced this regression:
> 
> [io grant] Swap IO::ArgFiles to IO::CatHandle impl
> 
> https://github.com/rakudo/rakudo/commit/f539a624043f5796fcefcca83412ee1ab66e0c4d


Thank you for the report, however there's no bug here.

The script you linked to has a bug in that it assumes `get()` gets from $*IN, 
when it actually gets from $*ARGFILES, which is set to $*IN when there are no 
arguments given, and is set to a CatHandle made out of @*ARGS when there are 
args.

The reason for the observed regression is that pre-commit `get()` actually 
ended up inadvertently marking the Failure obtained during read from 
non-existent file as handled, so it was never getting exploded. And now it does.

The script needs to be fixed by using `prompt` with no args instead.

Cheers,
ZZ

Reply via email to