Greetings,
Here is how I understand it.
in your code
my %res = map { $_ => do { my $re; $re .= $translations{$_} for split //; $re; } if !$res{$_}; } @words;

you are refering to the list being created, in this case the %res hash, from within the block doing the assignment, the  map {$_ => do {#code} if !$res{$_};}@words; line. If you take out the  if !$res{$_}; part your resulting %res hash will have the value of the last of any possible identical values in the @words array. My gut feeling is that its more the !$res{$_} part than it is the use of the %res hash on both sides... but then there is your second example of
my @b = (7,5,5,6); my @a; @a = map { $_ > 5 ? $_ : $a[0] } @b;

Which again makes me think it's the use of %res on both sides of the = sign. So a basic rule of thumb to use might be that map only works on the contents of @b and never questions @a, only gives (given your example above).
...that made more sense when I started.
Anyone else with a more concise explanation?

-InjunJoel

Update!
Perhaps its the getkey() that is making it unclear? Have a look at perldoc question (how to get info on getkey). The getkey() call was tripping me up in the map documentation when I read it. So assuming that getkey() is only working on $_ from @array and not anything related to %hash(for it may only giveth) it all makes sense...

"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo

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 injunjoel
in thread Map: Thou Has't Confounded Me For The Last Time! (Referring To The Array You Are Assigning To In Map) by Revelation

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.