#! perl -slw use strict; use List::Util qw[ first ]; sub leftSubset{ local $^W; my( $major, $minor) = @_; return @{$minor} == first{ $major->[ $_ ] ne $minor->[$_] } 0 .. @{$minor} } my @a = 'a' .. 'f'; print "\n@$_\n is left subset of \n@a: ", leftSubset( \@a, $_ ) ? 'YES' : 'NO' for ['a'..'c'], ['b'..'d'],[qw[a a b c]],[ reverse 'a'..'c'];; __END__ P:\test>junk2 a b c is left subset of a b c d e f: YES b c d is left subset of a b c d e f: NO a a b c is left subset of a b c d e f: NO c b a is left subset of a b c d e f: NO