# are all letters of X in Y? sub inclusive { my ($src, $dst) = @_; my %p; # I don't know which of these is optimal... # so I leave it up to you # for my $c (split //, $src) { while (defined(my $c = chop $src)) { return if !($p{$c} = 1 + index($dst, $c, $p{$c} || 0)) } return 1; }