my @queue = ( [$action1, $action2, $action3], [$action4, $action1, $action3], ...); # or possibly; my @queue = ( [1, 2, 3], [4, 1, 3]); # where [1, 2, 3] is a reference to an array of subscripts on an array of actions defined somewhere else. #### 0 ARRAY(0x80359f90) 0 1 1 2 2 3 1 ARRAY(0x8035a050) 0 4 1 1 2 3 2 ARRAY(0x803561e8) 0 7 1 3 2 0 3 9 #### my $action_ref = shift @queue; #### print $_, " - " foreach @$action_ref; # prints: 1 - 2 - 3 -