in reply to Complex data structure
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]; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Complex data structure
by hardburn (Abbot) on Oct 16, 2003 at 14:31 UTC |