in reply to Re: Hash merging!
in thread Hash merging!

Need to explain myself more...
I understand pointers. It's the semantics of the @$A... line that's baffling me.
I know values %b is returning and array
Also keys %b is returning an array
$A{array} doesn't seem to make sense and what exactly is the @ doing on the front.

Replies are listed 'Best First'.
Re^3: Hash merging!
by eibwen (Friar) on Apr 26, 2005 at 08:30 UTC

    my %hash; # the % sigil denotes a hash $hash{'element'} = 1; # the $ sigil denotes a scalar value (the 'eleme +nt' element of %hash)

    Similarly, the @ sigil in @$A{keys %b} denotes list context. I believe it interpolates as (verified):

    @$A{(c,d,f)} = (9, 16, 36);

    Which is essentially the same thing as:

    $A{c} = 9; $A{d} = 16; $A{f} = 36;

    Given that $A = \%a, you could skip the reference:

    $a{c} = 9; $a{d} = 16; $a{f} = 36;

Re^3: Hash merging!
by ysth (Canon) on Apr 26, 2005 at 09:09 UTC
    @varname{LIST} is a hash slice, a list of all the values of %varname for the keys in LIST.