Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Common Substrings

by Moron (Curate)
on Nov 15, 2005 at 14:04 UTC ( [id://508614]=note: print w/replies, xml ) Need Help??


in reply to Common Substrings

A.k.a. "how to handle a non-nested concurrent loop"...
sub common{ my @x = split( "", shift()); my $result = ''; my $x = shift @x; for my $y ( split( "", shift()) ) { ( $x eq $y ) or last; $result .= $y; $x = shift @x or last; } return $result; }

-M

Free your mind

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found