[Kc] Re: when multidim emulation works

Rafael Garcia-Suarez rgarciasuarez at free.fr
Mon May 12 02:25:37 CDT 2003


Quoting david nicol <whatever at davidnicol.com>:
> Is this a bug?
> 
> % perl -le '$e{(0,1,2,3)} = 3; @a=(0,1,2,3); print $e{@q=@a}'
> 
> % perl -le '$e{(0,1,2,3)} = 3; @a=(0,1,2,3); print $e{@a}'
> 
> % perl -le '$e{(0,1,2,3)} = 3; @a=(0,1,2,3); print $e{0, at a[1,2,3]}'
> 3
> % perl -le '$e{(0,1,2,3)} = 3; @a=(0,1,2,3); print
> $e{$a[0], at a[1,2,3]}'
> 3
> 
> 
> Well it is, because it isn't DWIM; but the question is, is
> $e{@a} supposed to interpolate $; or not?  I want it to and
> it doesn't seem to.

It's not ; the parser converts the hash subscript expression to
a join C<$;,...> only when this expression is an OP_LIST.
(Grep the sources for "jmaybe".)



More information about the kc mailing list