in reply to Getting individual lists from a bigger list

If you want to keep @bigList unchanged then you could use another array to keep start and end positions for each list added, something like this

#!perl; use strict; use warnings; my @test = ([ qw(A B C) ],[ qw(1 2 3 4)], [qw( x y )]); my @bigList = (); my @chunk = (); for my $ar (@test){ my @templist = @$ar; my $start = scalar @bigList; push @bigList,@templist; my $end = $#bigList; push @chunk,[$start,$end]; } print "@bigList \n"; # each smaller list for my $ar (@chunk){ my ($start,$end) = @$ar; print "@bigList[$start..$end] \n"; }
poj