On 05/07/2011 07:45 AM, Michael G Schwern wrote:
> I was just playing around with eval, trying to figure out if you can define an
> operator overload at runtime (seems you can't, good) and noticed this in the
> spec... [1]
>
> "Returns whatever $code returns, or fails."
>
> How does one get the compile error from an eval?
It's in $!, like all other errors.
> I don't see anything in the eval tests [2] that's checking for the error,
> just that it returned false.
>
> In addition, I'm surprised that eval doesn't throw an error when it fails.
I agree that eval shouldn't be catching errors, that's what try { } /
CATCH are for (and i know that other #perl6 regulars things similarly).
I dimly recall that Larry had an objection, but I can't remember what it
was :(
Cheers,
Moritz