in reply to Perl Array Question

$hash{1} is a reference to an array to get the values back dereference it:
#!/usr/bin/perl -w use strict; use warnings; my %hash ; $hash{1} = ["me","you"]; foreach my $item ( @{$hash{1}} ) { print "$item\n"; } exit;

update:Meant to point out tye's References quick reference for further reference.

-enlil

Replies are listed 'Best First'.
Re: Re: Perl Array Question
by rsiedl (Friar) on May 15, 2004 at 08:57 UTC
    Cool. Thanks for your help.