in reply to Regex to find intersection of two words

I thought I'd put my two cents in ...
#!/usr/bin/perl -wl use strict; for my $f( ['the','there'], ['abcde','gcdabef'], ['abe','lbbe'], ['forky','fork'] ) { print "@$f =>", fooey($f); } sub fooey { my ($this,$that) = @{$_[0]}; my $yes; for my $char(split'',$this) { ++$yes if $that =~ /\Q$char\E/; } return $yes == length $this? 1: 0; } __END__ the there =>1 abcde gcdabef =>1 abe lbbe =>0 forky fork =>0
my second take on this...
#!/usr/bin/perl -wl use strict; for my $f( ['the','there'], ['abcde','gcdabef'], ['abe','lbbe'], ['forky','fork'] ) { print "@$f =>", fooey($f); } sub fooey { my ($this,$that) = @{$_[0]}; my %yes; my $char = quotemeta $this; { $that =~ s/([$char])/$yes{$1}++/ge; } return ((scalar(keys %yes) == length $this? 1: 0); } __END__ the there =>1 abcde gcdabef =>1 abe lbbe =>0 forky fork =>0

 
______crazyinsomniac_____________________________
Of all the things I've lost, I miss my mind the most.
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"