in reply to whats wrong reverse %x = reverse %h?

Deparsed output:
perl -MO=Deparse -MData::Dumper -le '%h = (1 => 2, a=>"b", c => 2); %h + = reverse ( %x = reverse %h); print Dumper({x => \%x, h =>\%h});' BEGIN { $/ = "\n"; $\ = "\n"; } use Data::Dumper; (%h) = (1, 2, 'a', 'b', 'c', 2); (%h) = reverse((%x) = reverse(%h)); print Dumper({'x', \%x, 'h', \%h}); -e syntax OK
as stated above your reverse/reverse of the hash is causing you to lose dup keys...


-Waswas

Replies are listed 'Best First'.
Re^2: whats wrong reverse %x = reverse %h?
by borisz (Canon) on Sep 28, 2004 at 16:51 UTC
    Dont get me wrong, I really expect to lose the dup keys, but my output lose much more then the dupes.
    Boris