in reply to Re: Check if a word is included in another
in thread Check if a word is included in another

I like it. Straightforward, easy to read, and probably more efficient than making hashes, etc. Need to speed test to make sure. This is most like what I was looking for.
  • Comment on Re^2: Check if a word is included in another

Replies are listed 'Best First'.
Re^3: Check if a word is included in another
by LanX (Saint) on Apr 18, 2010 at 22:50 UTC
    Thanx, I like my code too! ;-)

    Unfortunately there is a typical "too clever for perl" bug 8-(

    please replace:

    # while ($a ) { while (length $a ) {

    otherwise qw/0 a/ will be a false positive!

    If you want performance you may wanna try tr///d instead, but you will need to eval.

    Cheers Rolf