Maybe I'm having a senior moment here, but I can't see how the statement in the OPed code
sub { ... };
# wander away...
can possibly do anything at all.
One could define and subsequently invoke a subroutine
sub func { ... }
# some other stuff...
func();
or define and save a reference to a subroutine and subsequently invoke it
my $coderef = sub { ... };
# some other stuff...
$coderef->();
or define a reference to a subroutine and immediately invoke it
sub { ... }->();
but I don't understand the definition of the OPed code, which just seems to define a subroutine reference and then immediately throw it away.
Am I missing something?
In reply to Re: Need Help in Understanding Some Code - Map and Scalar Questions
by AnomalousMonk
in thread Need Help in Understanding Some Code - Map and Scalar Questions
by Dru
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |