Re: Rationale for $!

[email protected] ("Todd C. Olson") Thu, 28 Jan 2016 15:06:07 +0000
Newsgroups perl.perl6.language
Message-ID <[email protected]>
Slight change in focus of question ...

> On We 2016-01-27, at 09:15, Felipe Gasper <[email protected]> wrote:
> ---------------
> use v6;
> 
> my $x = 10;
> my $y = 0;
> 
> my $z = $x / $y;
> 
> my $exception;
> {
>    {
>        say $z;
>        CATCH {
>            default {
>                $exception = $_;
>            }
>        }
>    }
> }
> 
> if ($exception) {
>    say "There was an exception: $exception ($!)";
> }
> 
> say "still running";
> ---------------


Is there a way to make the exception be thrown eagerly, at the devision statement rather than waiting until use, at the say statement?

Regards,
Todd Olson