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

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
From:
=?UTF-8?Q?Branislav_Zahradn=C3=ADk?=
Date:
June 22, 2021 08:12
Subject:
Re: RFC 0004 - defer {} syntax
Message ID:
CAB=rbOnvv0+W_QHPi+nUUvz91XOt1v8ckBcwsgYG2N7BcpQvkQ@mail.gmail.com
On Sun, 20 Jun 2021 at 14:23, Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
wrote:

>   sub wibble {
>     uplevel::defer { say "This runs after Hello" }
>   }
>
>   {
>     wibble();
>     say "Hello";
>   }
>
>
>
would in be better to use behaviour already used with redo/next/last ?

sub foo {
    LABEL: {
       if ($cond) { defer LABEL { ... } }
    }
}

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