in reply to Erm? Bug or not? Weird behaviour in hash / list conversion

Intriguing...

C:\Documents and Settings\Administrator\Desktop>perl -MO=Deparse -e"pr +int join('|', %{{ }} = (1)x100 );" print join('|', %{{};} = (1) x 100); -e syntax OK

C:\Documents and Settings\Administrator\Desktop>perl -MData::Dumper -e + "print Dumper( %{{ }} = (1) x 100);" Bizarre copy of ARRAY in anonlist at C:/Perl/lib/Data/Dumper.pm line 4 +45.

The conversion from list to hash is confusing things?

Replies are listed 'Best First'.
Re: Re: Erm? Bug or not? Weird behaviour in hash / list conversion
by etcshadow (Priest) on Oct 29, 2003 at 05:28 UTC
    Better yet... it appears to be entirely tied to the context of the hash-assignment operation, in a totally bizzare way:
    [me@host]$ perl -e '$x = [%y = (1,2,1,2)];' Bizarre copy of ARRAY in anonlist at -e line 1. [me@host]$ perl -e '%y = (1,2,1,2); $x = [%y];' [me@host]$

    ------------
    :Wq
    Not an editor command: Wq