Ah. Well, “lvalue” means “value which can appear on the left side of an assignment” which means “something that can be assigned to,” as opposed to a constant or some such. So “the list of lvalues assigned to” means “a list of aliases to the things you just changed.” And that is just what my examples show.

You are right that one cannot assign to a key. One can create or delete keys, but not manipulate them in any way. (In fact, internally, hash keys are plain strings, not fullblown scalars. That is why you can't use references as keys and expect those keys to still work as references.)

I used the join as an example of a hash slice, because slices work in assignment just as they work anywhere else. By using a hash slice you query the hash for a list of values, specified by the given list of keys, and what you get is that list of values. You can assign to that list just as you can assign to ( $foo, $bar, $baz ).

Makeshifts last the longest.


In reply to Re^7: hash slice ? No thanks, I'm about to return... by Aristotle
in thread hash slice ? No thanks, I'm about to return... by leriksen

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.