Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Find common prefix from a list of strings

by bobn (Chaplain)
on Jul 14, 2003 at 19:43 UTC ( #274130=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $posn = -1;
    my $same = 1;
    ...
    
    print 'Prefix is "', substr($files[0], 0, $posn), '"';
    
  2. or download this
    # UNTESTED
    
    ...
    }
    
    print "prefix: '",substr($file[0],1,$len-1), "'\n";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2020-01-21 04:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?