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