Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Find common prefix from a list of strings

by Aristotle (Chancellor)
on Nov 09, 2003 at 23:56 UTC ( #305753=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub maxprefix {
      my $p = shift;
      for (@_) { chop $p until /^\Q$p/ }
      return $p;
    }
    
  2. or download this
    sub maxprefix {
      my $s = reverse shift;
    ...
      chop $p;
      return $p;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2020-01-24 14:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?