Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Telephone Area Code Finder

by CharlesClarkson (Curate)
on Nov 12, 2001 at 13:24 UTC ( #124780=note: print w/replies, xml ) Need Help??


in reply to Telephone Area Code Finder

You could eliminate $number and add o to the area code match. Just check the whole line for the are code.

LISTING: while(<DATA>) { next LISTING unless /$area_code/o; # store the state/province my ($state) = m/^(\D+)/; print "$area_code: $state\n"; # once we have a match, don't continue # through the whole list last LISTING; }



HTH,
Charles K. Clarkson

It is not because things are difficult that we do not dare;
    it is because we do not dare that they are difficult.
- Seneca the Elder

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://124780]
help
Chatterbox?
[karlgoethebier]: silence after a post is the worst punishment ;-)
[karlgoethebier]: i guess i've been ikegamid, he

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2017-11-23 17:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (336 votes). Check out past polls.

    Notices?