perl syntax oddity

Yitzchak Scott-Thoennes <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Organization bs"d
Message-ID <[email protected]>
Can anyone give a justification why this should work as it does (or a
reasonable use):

$ perl -wle'sub getaglob {*loopvar} for ${&getaglob} (qw/the owl and the pussyc
at/) { print $loopvar }'
the
owl
and
the
pussycat

I was just browsing perly.y and saw that C< for $ BLOCK (... > is
(perhaps accidentally) valid syntax.  BLOCK is expected to return a
glob or globref.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.