The m[(^\0+)] match results in an undefined value for $mask when there is no common base substring at all, which then hiccups a "Use of uninitialized..." warning in the substr expression (if warnings are enabled). Happily, this is easily fixed by using m[(^\0*)] instead!
Give a man a fish: <%-{-{-{-<
In reply to Re^2: An efficient way to gather a common portion of several strings' beginnings
by AnomalousMonk
in thread An efficient way to gather a common portion of several strings' beginnings
by igoryonya
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |