in reply to Advice on loops

Just use a recursive routine to drill down. Witness:
my @array=(['john','tom','peter'],['rose','teak'],['car','truck','jeep +'],['trees','plants'],['good','bad','ugly']); my @arrayindex=(3,1); my @wanted = @array[@arrayindex]; # get slice show(@wanted); sub show { if (ref @_[0]) { # still recursing for (@{+shift}) { show(@_, $_); } } else { # end case print "@_\n"; # do what you want with the results here } }
This prints:
trees rose trees teak plants rose plants teak