in reply to Re: wantarray alternative (Context propagation)
in thread wantarray alternative
I don't seem to be answering as fast as you're asking.
If the explanation is that map is being called in scalar context, then the following is unexpected:
sub lowercase { my @out = map { lc } @_ ; return @out ; } $name = lowercase( 'Jim', "Jeff" ) ; ## $name == 2
Even though map is called in an array context, the results don't change.
Very clever solution, yours. Clever, but not elegant.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: wantarray alternative
by LanX (Saint) on Jul 10, 2013 at 21:29 UTC | |
by tqisjim (Beadle) on Jul 10, 2013 at 22:28 UTC |
In Section
Seekers of Perl Wisdom