I get different results depending on whether or not $f is quoted in the for list:
sub f2a { my ($f) = @_; for my $d ("$f") {return $d} } sub f2b { my ($f) = @_; for my $d ($f) {return $d} } print map {f2a($_)} qw(x y z); # zzz print map {f2b($_)} qw(x y z); # xyz
I also ran it through B::Deparse, but gained no insight.
In reply to Re: "map" sometimes uses only the last mapped value
by bobf
in thread "map" sometimes uses only the last mapped value
by jesuashok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |