in reply to How to select an array

And here's a case-specific solution.

use strict; use warnings; # array choices my %arrays = ( ab => [ "one", "two", "three" ], cd => [ "four", "five", "six" ], ef => [ "seven", "eight", "nine" ], ); my $sel = join '', @ARGV[0..1]; # Print contents of the chosen array foreach my $item (@{$arrays{$sel}}) { print "$item\n"; }

Replies are listed 'Best First'.
Re^2: How to select an array
by Alpine (Initiate) on Sep 18, 2007 at 15:56 UTC
    Thank you for this solution. I didn't think about using 'hashes'.
    --Alpine