in reply to Re: hash problem
in thread hash problem

Without $x:
my @keys = qw(one two three); my $hash = 1; $hash = { $_=> $hash } for reverse @keys;
Of course this fails if @keys is empty

Dave.

Replies are listed 'Best First'.
Re^3: hash problem
by BrowserUk (Patriarch) on Jul 09, 2004 at 20:50 UTC

    That's the one :)


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon