See perlref. Alternatively (and I like this syntax better),foreach my $key (sort keys %hash){ print @{$hash{$key}}[0]; #prints a1 for first hash print @{$hash{$key}}[1]; #prints b1 for first hash print @{@{$hash{$key}}[2]}[0]; #prints c2a }
foreach my $key (sort keys %hash){ print $hash{$key}->[0]; print $hash{$key}->[1]; print $hash{$key}->[2]->[0]; }
In reply to Re: Complex data structure
by The Mad Hatter
in thread Complex data structure
by neilwatson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |