Thanks for the help. I was actually able to get the end results I wanted with a little help. Here's the script:
# while (<IN_FILE>) { # chomp; # if ( (m|State=|)) { # $state = $'; # print "State=$state\n"; # } elsif ( (m|City=|)) { # $city = $'; # print "City=$city\n"; # print "Location=$city$state\n"; # } # } Thanks again, Jose Malacara >From: Kristina Nairn <[EMAIL PROTECTED]> >To: "Jose Malacara" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] >Subject: Re: question >Date: Wed, 10 Jul 2002 14:08:21 -0500 > >Sounds like the right place for a hash of arrays. Let your keys be the >states and your values be anonymous arrays of cities. Like so: > > %sites = ( 'Colorado' => [ qw(Denver Boulder) ], > 'Texas' => [ qw(Austin Dallas >Houston) ] ); > >I'd build the Location field only as I needed it for printing. > >foreach $state (sort keys %sites) { > foreach $city (sort @{ $sites{$state} }) { > print "Location = $city$state\n"; > } >} > >Cheers, >Kristina Nairn _________________________________________________________________ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]