Seperating a scaler into various components.



I work at UPS and currently wish to change positions. The position
requires me to learn a large amount of US zip codes. I've also been
working through the "Learning Perl" book by Schwartz and
Christiansen as hobby ( yall can't have all the fun ). I want to
create an app that will test my knowledge of zip codes. I have to know
which zip codes to send to different parts of the building. The list of
zip codes are in a text file that looks like this:

37016 AUBURNTOWN TN ORANGE
37082 KINGSTON SPRINGS TN ORANGE
37601 JOHNSON CITY TN BLACK
37616 ASHTON TN GREEN
38128 BARTLETT TN BLUE
.... and so on.

Each line is read in as a scaler but I need to separate the scaler into
$zip, $city, $state, and $color. Here's how I'm trying to do it:

( $zip, $city, $state, $color ) = /(\S+)\s+(\S+)\s+(\S+)\s+(.*)/;

The problem is when the city is 2 words. I also don't know how to deal
with a blank line which produces some error messages.

.



Relevant Pages

  • Re: Bye bye Miss American Pie...the levee wasnt dry!
    ... regulations and codes. ... My own homeowner's policy automatically escalates in payoff amount ... Our policy has the extended replacement cost and code upgrade items as part ...
    (alt.usage.english)
  • Re: Bye bye Miss American Pie...the levee wasnt dry!
    ... > regulations and codes. ... > My own homeowner's policy automatically escalates in payoff amount ... also a separate rider on our insurance. ...
    (alt.usage.english)
  • Re: Insert Column after specific text title the new column and add
    ... Thank you for taking the time and writting the codes, ... however it could be as simple as +the value in amount column/1000. ... Dim FoundCell As Range ... Dim myStr As String ...
    (microsoft.public.excel.misc)
  • Open form on two criteria
    ... I have a form that contains an amount field and a combo box which has three ... For example i have three codes... ... selection of expression builder, code ...
    (microsoft.public.access.formscoding)
  • Re: reopen a file
    ... I didn't close file becasue I will get to ask whether I ... save large amount of data [that I copy and ... problem and when other poeple running my codes on their ... How can I avoid this message? ...
    (microsoft.public.excel.programming)