On Fri, Apr 15, 2005 at 03:27:27AM +0300, Roie Marianer wrote:
: > %hash<< a $key_b c >> :key<< a $value_b c >>
: > %hash� a $key_b c � :key� a $value_b c �
: Just to be certain, these are both equivalent to
:
: @hash{'a', $key_b, 'c'} key => ['a', $value_b, 'c']
:
: in Perl 5, right?
Close. It's actually more like:
@hash{split " ", "a $key_b c"} key => [split " ", "a $value_b c"]
That is, the interpolation happens before the implicit split. That's
why
<< $str >>
� $str �
are equivalent to P5's split(" ", $str). And
� @lines �
will interpolate all the lines and then split the whole mess on words.
Larry