in reply to Re^10: Combinations of lists, etc
in thread Combinations of lists to a hash

Well said, LanX.

Well, it wasn't LanX, but...

... when taking such "exact" copies of a string, you can modify the copy without affecting the original ...

Yes, because in the case of x, scalars (e.g., strings) are copied (and concatenated) by value, so the copy is independent.

... this is not the case when taking such "exact" copies of things like hash keys ...

Hash keys are strings (scalars).

... & values, because the copy will be some kind of reference to the original?

The value of a hash key/value pair (or item of an array (update: or list)) is always a scalar. A scalar can be a reference. (A reference is always a scalar.) Operator  x copies things exactly, but two or however many exact copies of a given reference always point to a single thing: the "referent". A referent may be referenced by any number of references. (Update: See reference, perlref, perlreftut, and perldsc.)


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^12: Combinations of lists, etc
by tel2 (Pilgrim) on Oct 08, 2019 at 23:02 UTC
    OK, thanks again AnomalousMonk, and sorry for renaming you to LanX.  (Where's the "unrename" function when I need it?)