in reply to Matching data against non-consecutive range
I do not think that I would ever use a regex to match specific numbers in a given range. I would use a lookup table instead.
#!/usr/bin/perl use strict; # Zone 8 my %z8; $z8{$_}++ for ( 10..374, 376..379, 382..385, 388..499, 530..534, 541.. +543, 618, 619, 700..704, 707..709 ); my $num = "34"; print "Found it!\n" if $z8{$num};
Another option would be to pull the zone information using Business::UPS. Store it in a database or use Storable's freeze and thaw to save and load your data. You'll probably also want to determine how often to automatically freshen your information.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Matching data against non-consecutive range
by bart (Canon) on Jan 27, 2005 at 22:07 UTC | |
by demerphq (Chancellor) on Jan 28, 2005 at 14:17 UTC | |
by bart (Canon) on Jan 30, 2005 at 11:04 UTC | |
by Spooner (Acolyte) on Jan 30, 2005 at 09:32 UTC |