... my %pets; my $color = 'black'; # $pets{$color} = []; # this line is unnecessary push @{ $pets{$color} }, 'cat'; push @{ $pets{$color} }, 'dog'; foreach my $p (values %pets) { print "@$p\n"; }
In reply to Re: Cruel references
by trammell
in thread Cruel references
by uksza
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |