develooper Front page | perl.perl5.porters | Postings from January 2012

Re: [perl #108730] 5.12.3 breaks use of when outside a topicalizer(!!!)

Thread Previous | Thread Next
From:
Eric Brine
Date:
January 21, 2012 22:10
Subject:
Re: [perl #108730] 5.12.3 breaks use of when outside a topicalizer(!!!)
Message ID:
CALJW-qGiZ6YqcFQggE-dqkY5K-euoEtErspDcsmiw=hRuWxiKw@mail.gmail.com
On Sun, Jan 22, 2012 at 12:21 AM, Linda Walsh <perlbug-followup@perl.org>wrote:

> Can someone explain to me the rational for the interpreter
> to 'restrict' the usage of 'when' to a smaller subset than
> where 'last/next/continue' would work


C<when> was primary written to compare to $_ (e.g. C<< when ("foo") >>), so
it's only allowed in flow control statements that set $_ (e.g. C<< for
(...) >>, but not C<< for my $x (...) >> and C<< for (...; ...; ...) >>).


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