On Sat Nov 28 07:49:05 2015, barto...@gmx.de wrote:
> There was a short discussion on #perl6 about this recently:
> http://irclog.perlgeek.de/perl6/2015-11-17#i_11554013
> 
> ZoffixW         How come $! is empty?
>                 m: my ( $v1, $op, $v2 ) = (2, '-', "zoffix"); my $x =
> try { EVAL "$v1 $op $v2"; CATCH { fail "Invalid operand to Color: Got
> error $!" } }; say $x
> camelia         rakudo-moar a662e0: OUTPUT«Use of Nil in string
> context  in block  at /tmp/Dg9t65PMrW:1␤===SORRY!===␤Invalid operand
> to Color: Got error ␤»
> * ZoffixW       is going by http://learnxinyminutes.com/docs/perl6/
> that $! should contain the error message in that case
>                 Um. never mind.
> psch            m: my ( $v1, $op, $v2 ) = (2, '-', "zoffix"); my $x =
> try { EVAL "$v1 $op $v2"; }; say $!
> camelia         rakudo-moar a662e0: OUTPUT«5===SORRY!5=== Error while
> compiling /home/camelia/EVAL_0␤Undeclared routine:␤    zoffix used at
> line 1␤␤»
> * ZoffixW       is really lost
> psch            $! is set after the CATCH, inside you get $_
>                 not sure if that's correct though, but it's what's
> impl'd
> ZoffixW         Ah, thanks psch++

And as a follow up: http://irclog.perlgeek.de/perl6/2015-11-17#i_11554347

vendethiel    but perhaps someone who knows the rules of CATCH a bit more than 
I do can confirm what psch++ 
              said http://irclog.perlgeek.de/perl6/2015-11-17#i_11554028
jnthn         vendethiel: Believe so. It's $_ inside of CATCH 'cus you want to 
be able to smartmatch on it

Reply via email to