Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a hash from database field?

Status
Not open for further replies.

copykat

Technical User
May 25, 2006
2
US
I know how to access (open and close) my datafile, but I am not sure how to create a %hash from one of the fields.

My thoughts are: %hash{$list} = %hash{$list} + 1;

Where $list is the field in my data file and %hash is where I am storing all the variables. But this is not working.
 
Hi

Please note that your question has nothing with CGI. The adequate forum is forum219 ( Perl ).

Anyway, I did not understand too musc from your problem. Could you post a short sample from the data file and the code in which you read it and set $list ? And explaint abit more detailed what you want in %hash.

Feherke.
 
$hash{$key}++ is what you're after

HTH
--Paul

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top