rfb has asked for the wisdom of the Perl Monks concerning the following question:

I'm sure I've dont this before, but this time it only returns:
name -- name name -- name
my %field_def = ( name => "name", country => "country", province => "province", description => "description", url => "resort_url", tubs => "tubs", pool => "pool", parking => "parking" ); for (my ($key, $val) = each (%field_def)) { print "$key -- $val\n"; }
hmm. -rfb

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Answer: for (($key, $val) = each (%hash)) { } question
by rfb (Sexton) on Jan 12, 2001 at 23:22 UTC
    arge, felt a bit better to find stupid mistakes like that on my own.. thanks anyway
Answer: for (($key, $val) = each (%hash)) { } question
by japhy (Canon) on Jan 12, 2001 at 23:16 UTC
    Use while, not for.
Answer: for (($key, $val) = each (%hash)) { } question
by Coyote (Deacon) on Jan 12, 2001 at 23:20 UTC
    Try a while loop rather than a for loop.