in reply to Re: Re: Pulling Array Out of Hash Reference
in thread Pulling Array Out of Hash Reference

Which can also be written as

print @$hashRef{'a','d'};

as outlined in references quick reference (which is how I finally figured out that all of this syntax is pretty easy to keep straight).

But I think I'd stick with

print @{$hashRef}{'a','d'};

as being clearer.

- tye        

Replies are listed 'Best First'.
Re: Re^3: Pulling Array Out of Hash Reference
by antirice (Priest) on Apr 13, 2004 at 00:13 UTC

    Yes, but I normally use @{hashref}{LIST} since it puts me in the habit of not doing something goofy like trying to change

    @$hashRef{LIST}

    into

    @$array_ref->[INDEX_OF_HASHREF]{LIST}

    during those late night coding sessions.

    antirice    
    The first rule of Perl club is - use Perl
    The
    ith rule of Perl club is - follow rule i - 1 for i > 1