Nice solution; ++tye.
Changing
to$len= length( ( $dif =~ /^(\0+)/ )[0] );
will make it run quiet under warnings when the common prefix is the empty string.$len= length( ( $dif =~ /^(\0+)/ )[0] || '' );
-sauoq "My two cents aren't worth a dime.";
In reply to Re: Re: Find common prefix from a list of strings (tye)
by sauoq
in thread Find common prefix from a list of strings
by Albannach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |