Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Suffix-prefix matching done right

by LanX (Saint)
on Nov 04, 2021 at 18:27 UTC ( [id://11138438]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11138438]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2024-04-25 05:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found