in reply to Using Scalar In Array Name?
A hash-of-arrays, e.g.:
>perl -wMstrict -le "my %STATION_LIST = ( 6 => [ qw/A B C D E F/ ], 4 => [ qw/A B C D/ ], 99 => [ qw/foo bar baz/ ], ); ;; my $STATION_CNT = 99; ;; foreach my $stid (@{ $STATION_LIST{$STATION_CNT} }) { print qq{station '$stid'}; } " station 'foo' station 'bar' station 'baz'
|
|---|