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.