in reply to Selecting Correct Array

My first thought is "Use a hash!". eg.

my %menu = { info => \@menu_info, sell => \@menu_sell }; #then.. .... print $menu{info}[0]; # First thing in the @menu_info array. print $menu{sell}[0]; # First thing in the @menu_sell array.

Update: I should have mentioned that:

my $foo = 'info'; print $menu{$foo}[0]; # will print the first item in @menu_info as wel +l

Update2: changed @ to $ on array element references. Thanks Tadman.


What's this about a "crooked mitre"? I'm good at woodwork!