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

Re: assigning array to hash

Thread Previous | Thread Next
Jeff 'japhy' Pinyan
April 26, 2002 06:56
Re: assigning array to hash
Message ID:
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
RPI Acacia brother #734
** 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 | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About