http://www.perlmonks.org?node_id=102088


in reply to Re: Re: Re: Can I match a range from an array?
in thread Can I match a range from an array?

OK That's really neat, I wasn't thinking at it like that. I kind of thought that's what you wanted me to do but wasn't sure, I see now though. However, one final problem, OK, I don't know what any of the lines will be so how do I tell the script that if it matches one of the numbers to print out the correct value from the hash.

You're telling it to print out Miami for $cells{1} but I don't know what the cell site line is going to be it might be 503E so I'd have to tell it somehow to print out the name when you find the number in the record block and in the hash so it knows what key/value to print. So my dilemma is really the printing and matching.

I can do both for a single match no problem. However I have to do 387 of them because there are 387 different Cell site names. So how can I tell the if statement this.

Well your regex will match any cell site line I know that, and if it's under the "if (lastHeading = "MSTerminating)" then it will only evaluate in an "MSTerminating" record block so that one is good and now the final problem which I haven't been able to solve. How do I tell the script to print out the line without knowing what number will be matched. In my current script I don't know why "$_" won't print, but that's the only way I can guess to print out something when you don't know what the answer will be but you know what you want to do with the answer.

The Brassmon_k