in reply to Fast lookup for prefixes in hash
$pat = join '|', sort { length($b) <=> length($a) } keys %prefix; if ($number =~ /^($pat)/) { print "Prefix: $1\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: Fast lookup for prefixes in hash
by tye (Sage) on Oct 31, 2001 at 21:05 UTC | |
by japhy (Canon) on Oct 31, 2001 at 21:12 UTC | |
by tilly (Archbishop) on Oct 31, 2001 at 22:06 UTC | |
by japhy (Canon) on Oct 31, 2001 at 22:15 UTC |