in reply to Suffix-prefix matching done right

FWIW: you might be able to use Bitwise String Operators to your benefit. (with different sub-strings of $A and counting the ` afterwards with tr )

But I have problems to match documentation with the behavior of 5.32

DB<32> p "$A $B" abbaba babbaaaa DB<33> no feature 'bitwise'; print 'abbaba' & 'babbaaaa' ``b``a DB<34> no feature 'bitwise'; print $A & $B 0 DB<35> no feature 'bitwise'; print "$A" & "$B" ``b``a DB<36> print "$A" & "$B" 0 DB<37>

looks like feature bitwise is now default w/o being explicitly explained in perlop

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery