in reply to Dereferencing a Hash of Arrays

Values returns an array.

The values function returns a list.

say for values %alphabet;

Updated as jwkrahn suggested, thanks.

Replies are listed 'Best First'.
Re^2: Dereferencing a Hash of Arrays
by jwkrahn (Abbot) on Jun 14, 2011 at 07:16 UTC
      Yes, I should 'use strict' when explaining about Perl functions :)
Re^2: Dereferencing a Hash of Arrays
by toro (Beadle) on Jun 14, 2011 at 07:09 UTC
    Well, it returns two arrays. How do I get the program to spit out [1, 2, 3, 4]; [9, 8, 7, 6] ?
      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 ""?