develooper Front page | perl.beginners | Postings from April 2002

Re: assigning array to hash

Thread Previous
From:
richard noel fell
Date:
April 26, 2002 07:15
Subject:
Re: assigning array to hash
Message ID:
3CC9650A.839B9E8A@rcn.com
Jeff -
	Thanks for your reply. Now, on to solve the remaining problems.
Dick Fell









Jeff 'Japhy' Pinyan wrote:
> 
> On Apr 26, richard noel fell said:
> 
> >Below is part of some code that reads from a file to an array and then
> >attempts to assign the array to a hash.  I get no compiling errors, but
> >%label_hash is empty. No doubt I am being stupid. Has anyone a
> >suggestion how to fill the hash variable?
> 
> The hash is not empty -- printing "%foo" does nothing special.  To dump a
> hash, do something like:
> 
>   for (keys %hash) {
>     print "$_ => $hash{$_}\n";
>   }
> 
> --
> Jeff "japhy" Pinyan      japhy@pobox.com      http://www.pobox.com/~japhy/
> RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
> ** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
> <stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
> [  I'm looking for programming work.  If you like my work, let me know.  ]

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About