in reply to Re: Variable naming of Arrays
in thread Variable naming of Arrays

Thanks a lot.

I dont suppose you can use 'push' with hashes as well?

something like

$arrays{bart} = [ 1, 2, 3 ]; push ($arrays{bart}, [ 4, 5 ];
Thanks

Replies are listed 'Best First'.
Re^3: Variable naming of Arrays
by davorg (Chancellor) on May 12, 2006 at 16:14 UTC

    You can't use push with a hash. But you can use push with an array reference if you dereference it first.

    $arrays{bart} = [ 1, 2, 3 ]; push @{$arrays{bart}}, 4, 5;
    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg