in reply to Re: Dereferencing a Hash of Arrays
in thread Dereferencing a Hash of Arrays

Well, it returns two arrays. How do I get the program to spit out [1, 2, 3, 4]; [9, 8, 7, 6] ?

Replies are listed 'Best First'.
Re^3: Dereferencing a Hash of Arrays
by stefbv (Priest) on Jun 14, 2011 at 07:15 UTC
    Only one :), with 2 array refs. (AoA)
    say "@$_" for values %alphabet;
      Thanks stefby, that works. But I don't understand why. Where does $_ derive from in this case, and why do I need ""?

        From the perlvar man page: $_ is "The default iterator variable in a foreach loop if no other variable is supplied."

        Using double quotes is equivalent with a join operation that uses a space as EXPR.

        join(' ', @$_)
        Most every perl comes with perldoc
        $ perldoc -v $_ $ARG $_ The default input and pattern-searching space. The followi +ng ... ... ... ... ... ... ... (Mnemonic: underline is understood in certain operations.)