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

Re: smartmatch needs your eyes

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
October 6, 2015 17:39
Subject:
Re: smartmatch needs your eyes
Message ID:
20151006173925.GA27535@cancer.codesimply.com
* Dave Mitchell <davem@iabyn.com> [2015-10-06T12:03:30]
> So for final clarity, is
> 
>     when (EXPR) {...}
> 
> intended to always be exactly equal to 
> 
>    if ($_ =~ EXPR) {...; break }

Yes.

> If so, how does one write something functionally equivalent to when(1)
> now?

when { $_ == 1 } { ... }

-- 
rjbs

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