in reply to Can I match a range from an array?
If you were going to add or remove strict or warnings, that would be after the code was frozen.#!/usr/bin/perl -w use strict;
OK.. your issue: I think you're trapped by the notion that you have to use a regex to match that number. You don't. You do need one to capture it though. Why not just capture it to $1 or $2 or whatever it happenes to be in the pattern match and then use what was designed for this very thing... a hash. Store all of your cell site codes as the key and whatever is associated with that as the value. Then just do a ..
Or whatever you want to do with $1.if $cellsites{$1} { print "Cell site is: $cellsites{$1}\n"; } else { print "No cell site information for $1\n" }
Hope this helps..
Rich
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Can I match a range from an array?
by brassmon_k (Sexton) on Aug 03, 2001 at 18:28 UTC | |
by rchiav (Deacon) on Aug 03, 2001 at 19:05 UTC | |
by dragonchild (Archbishop) on Aug 03, 2001 at 19:21 UTC | |
by brassmon_k (Sexton) on Aug 03, 2001 at 22:33 UTC | |
by rchiav (Deacon) on Aug 03, 2001 at 23:08 UTC | |
by brassmon_k (Sexton) on Aug 04, 2001 at 00:18 UTC | |
by brassmon_k (Sexton) on Aug 03, 2001 at 19:25 UTC | |
by snafu (Chaplain) on Aug 04, 2001 at 00:14 UTC | |
by brassmon_k (Sexton) on Aug 04, 2001 at 00:33 UTC |