Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Find common prefix from a list of strings

by qmole (Beadle)
on Jul 14, 2003 at 21:00 UTC ( #274169=note: print w/replies, xml ) Need Help??


in reply to Find common prefix from a list of strings

Not exactly golfed to death, but:
@files = qw(model4run1 model2run1 model4run2 model1run1); $x++,"$files[0] "=~/(.{$x})/ while (grep/^$1/,@files)==@files; chop($_=$1); print;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2020-01-21 05:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?