in reply to Re^4: (german) region code detection - request for thoughts
in thread (german) region code detection - request for thoughts
etc.use List::Util; my $min_prefix_length = min keys %prefixes; my $max_prefix_length = max keys %prefixes; my $prefix_length = $max_prefix_length; while ( $prefix_length-- >= $min_prefix_length) { last if exists $prefixes{ substr( $phone, 0, $prefix_length) }; } # Error/inexistent prefix if $prefix_length < $min_prefix_length;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: (german) region code detection - request for thoughts
by Skeeve (Parson) on Aug 20, 2008 at 15:22 UTC |