in reply to Need Help in Understanding Some Code - Map and Scalar Questions
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?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Need Help in Understanding Some Code - Map and Scalar Questions
by Your Mother (Archbishop) on Oct 31, 2010 at 03:33 UTC | |
by AnomalousMonk (Archbishop) on Oct 31, 2010 at 05:52 UTC |