in reply to Re: Construction/initialisation of empty hash
in thread Construction/initialisation of empty hash

Thanks, that's a helpful one-liner.

Perl 5.8.0 gives the output you show, however, my older version (which is 5.004_04) gives:

$ /opt/perl5/bin/perl -MData::Dumper -we '%h={};$h{a}=1;print Dumper \ +%h' Odd number of elements in hash list at -e line 1. $VAR1 = { 'a' => 1 };

Replies are listed 'Best First'.
Re: Re: Re: Construction/initialisation of empty hash
by Anomynous Monk (Scribe) on Apr 27, 2004 at 17:17 UTC
    Just speculating; did perl used to drop off odd elements in hash initialization instead of adding an implied undef to make things even out?