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

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

Thread Previous
Yuki Kimoto
October 20, 2021 02:01
Re: Pre-RFC: try/catch/finally and generic finally blocks
Message ID:
2021-10-20 4:07 Elvin Aslanov <> wrote:

> > I don't think we should try too hard to give these meanings, as it's
>    rather unclear what they should do. Likely those should continue to be
>    syntax errors for now, and we just focus on the bare-block and
>    try/catch cases. At least for now.
> I fully agree with this paragraph.
> Bare blocks and try/catch pair fit best with finally.
> Thanks.

Me too.

try/catch pair with finally.

  try {
    say "This happens first";
  catch ($e) {
    say "Oops, a failure happened";
  finally {
    say "This always happens, regardless of success or failure";

And Bare block with finally

    ## 100 lines here
  finally {
    say "Oh and just do this before you go"

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About