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; }
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
In reply to Re: Telephone Area Code Finder
by CharlesClarkson
in thread Telephone Area Code Finder
by zeno
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |