develooper Front page | perl.perl5.porters | Postings from October 2021

Re: Pre-RFC: try/catch/finally and generic finally blocks

Thread Previous | Thread Next
From:
Tom Molesworth via perl5-porters
Date:
October 20, 2021 05:07
Subject:
Re: Pre-RFC: try/catch/finally and generic finally blocks
Message ID:
CAGXhHdkq0z1Rey5EK=0MN4nS7vH9UWOtSwE3ar+=JpGOGJLjvQ@mail.gmail.com
On Wed, 20 Oct 2021 at 12:57, Oodler 577 via perl5-porters <
perl5-porters@perl.org> wrote:

> I guess I don't understand the value of providing this for a bare block,
> and the only value I can see in any other block structure is to extend
> scope "one more time".
>
>     # currently
>     my $i;
>     for $i (1..10) {
>       # do stuff
>     }
>     if ($i < 10) {
>       print qq{Loop exited early!\n};
>     }
>

Consider `die`, `next OUTER` or `return` in the `# do stuff` section. Any
of those would give different results for the finally vs. code-after-loop
versions.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About