ElMagnifico has asked for the wisdom of the Perl Monks concerning the following question:
"CHEVY","US","UNITED STATES" "MERCEDES","DE","GERMANY" "PEUGOT","FR","FRANCE" "FORD","US","UNITED STATES" "LADA","RU","RUSSIAN FEDERATION" "SATURN",US","UNITED STATES" "ROLLSROYCE","UK","UNITED KINGDOM "BMW","DE","GERMANY" <c> </p> As the file is read via a while() loop I'm putting the country code (i +.e. US, DE, etc.) into a hash.</p> <c> while(<DB>) { @db = split/,/; push(@countries,$db["1]); }
I need to do the following:
My questions:
1) Is a hash the proper structure for what I'm trying to do?
2) If so, how do I get it to do what I'd like?
Thank you in advance for your help. My experience is at the beginner level and I sincerely appreciate your help.
Rob
ElMagnifico - I work at it so that maybe one day it'll be true! :-D
20080205 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Need help on hashes.
by moritz (Cardinal) on Feb 03, 2008 at 20:15 UTC | |
by cdarke (Prior) on Feb 04, 2008 at 09:08 UTC | |
by ElMagnifico (Initiate) on Feb 04, 2008 at 23:06 UTC | |
Re: Need help on hashes.
by apl (Monsignor) on Feb 04, 2008 at 01:09 UTC | |
Re: Need help on hashes.
by leighsharpe (Monk) on Feb 04, 2008 at 02:13 UTC | |
by quester (Vicar) on Feb 04, 2008 at 04:07 UTC | |
by Errto (Vicar) on Feb 04, 2008 at 19:53 UTC | |
Re: Need help on hashes.
by ww (Archbishop) on Feb 05, 2008 at 02:44 UTC |