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_0Undeclared 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++