- or download this
my @array = (
[ qw( jane 23 teacher ) ],
...
[ qw( larry 19 manager ) ],
[ qw( wall 23 teacher ) ],
);
- or download this
my @array;
while( <DATA> ) {
...
jane 23 teacher
james 20 tailor
...
- or download this
use constant NAME => 0;
use constant AGE => 1;
...
$hash{$aref->[NAME]} = $aref;
}
}
- or download this
foreach my $name ( sort keys %hash ) {
local $, = q{, };
say $name, $hash{$name}[AGE], $hash{$name}[JOB];
}