in reply to Named array indices

Depending on your situation, you may also find Data::Alias to provide a good alternative.

use Data::Alias; my @array = ( [1,2], [3,4], [5,6], ); foreach my $list (@array) { alias my ($first, $second) = @{$list}; print $first, $second; }

Any performance hit will be trivial, and you'll get a performance boost over an array if you access the values more than once.

Replies are listed 'Best First'.
Re^2: Named array indices
by LanX (Saint) on Aug 06, 2010 at 13:03 UTC
    Thanks, but in my special case I would need to intialize the alias each time I'm accessing the data. So IMHO the overhead would kill the speed-gain...

    Cheers Rolf