in reply to Re^3: Longest String Matchingin thread Longest String Matching
Adding the empty string to the lexikon allows the following shortening:
$lookup{''} = 1; substr($word, 0, 1) = "" while !exists $lookup{$word}; [download]