Noting a point which hasn't come up yet:
which I assumed, in accordance with perldoc, would roughly translate to:
my %res; foreach my $word (@rw) { $res{$word} ||= do { my $re; $re .= $translations{$_} for split //,$word; $re; } }
No, it doesn't. You are using || here; that shortcircuits, ie if $res{$word} already exists (and is true), then the do {} won't even execute. There's no way to duplicate this with map.
Btw, this:
my $re; $re .= $translations{$_} for split //,$word; $re;
is more succintly expressed as
join '', @translations{ split //, $word };
Makeshifts last the longest.
In reply to Re: Map: Thou Has't Confounded Me For The Last Time! (Referring To The Array You Are Assigning To In Map)
by Aristotle
in thread Map: Thou Has't Confounded Me For The Last Time! (Referring To The Array You Are Assigning To In Map)
by Revelation
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |