in reply to Array of Arrays with Variable Names
I'm not really following what you are trying to do, but it sounds to me like you need either a Hash of Arrays or an Array of Hashes (where the hashes are a single key => value pair and the value is your array) if you need to preserve order.
Hope this helps. :/#!/usr/bin/perl -l use strict; use warnings; my %unordered = ( foo => [qw(foo baz baz)], bar => [0 .. 9], ); print for @{ $unordered{foo} }; print "--------"; my @ordered = ( { foo => [qw(foo baz baz)] }, { bar => [0 .. 9] }, ); print for @{ $ordered[1]->{bar} };
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Array of Arrays with Variable Names
by JWM (Initiate) on Aug 25, 2006 at 17:27 UTC | |
by mreece (Friar) on Aug 25, 2006 at 17:39 UTC | |
by JWM (Initiate) on Aug 25, 2006 at 18:16 UTC | |
by mreece (Friar) on Aug 25, 2006 at 18:35 UTC | |
by Not_a_Number (Prior) on Aug 25, 2006 at 18:05 UTC |