in reply to Regex to find intersection of two words
or, similar to andye and Juerd above,sub includes { my($in, $test) = @_; my $ins = join '', sort split//, $in; my $ts = join '.*', sort split//, $test; return $ins =~ /$ts/ || 0 }
sub includes { my($in, $test) = @_; return (length $test == grep $test=~s/$_//, $in=~/./g) ||0; }
|
|---|