in reply to Matching arrays

I'd map your second array to a hash and then loop over the elements of the first hash array, bombing out when the key in question does not exist:
use strict; my @subarray=qw(1 2 3); my @array1=qw(1 2 3 4 5 6); my @array2=qw(2 3 4 5 6); print contains(\@subarray, \@array1)?"Yes":"No"; print "\n"; print contains(\@subarray, \@array2)?"Yes":"No"; sub contains { my $array=shift; my $container=shift; my %container=map { $_ => undef } @$container; foreach (@$array) { return 0 unless (exists $container{$_}); } return 1; } __END__ Yes No
Note that there are some interesting points on array manipulations like this in perlfaq4.

CU
Robartes-