in reply to hash loop print

Seekers of Perl Wisdom I am looking for an answer to this problem of printing out a hash from 1 to 10 I read this in a book push(@{$hash{"KEYNAME"} }, "new value"); To use references to arrays as the hash values Then, deference the value as an array reference when printing out the hash foreach $string {keys %hash) { print $string: @{hash{$string)}\n I would like to do thiis but I don't understand.

Replies are listed 'Best First'.
RE: Re: hash loop print
by kelsey (Initiate) on Oct 06, 2000 at 06:28 UTC
    The answer is ! push(@{ $hash{"KEYNAME"} },"1,2,3,4,5,6,7,8,9,10"); foreach $string (keys %hash) { print "string: @{$hash{$string}} \n; }