my @biglist = qw(0 1 3); # already saved data while (my @newList = &GetNewList() ){ @newList = sort { $a <=> $b } (@newList); unless ($bigList[-1] == $newList -1){ # Error } # unless else { my @testList = ((scalar @bigList)..($#bigList+$#newList)); # build + template list to compare unless ("@testList" eq "@newList"){ # Error } # unless else { push (@bigList, @newList); } # else } # unless } # while # -------------------------------------- sub GetNewList { return (qw(2 4 6 5)); # or whatever } # GetNewList
In reply to Re: Re: joining and sorting arrays
by strat
in thread joining and sorting arrays
by hotshot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |