stan2004 has asked for the wisdom of the Perl Monks concerning the following question:
I'm excpecting:@hash{'one'} = "123"; @hash{'two'} = "123"; @hash{'three'} = "123"; foreach ($key = keys(%hash)) { print "key is - $key\n"; }
but, I got number of keys.one two three
Why ? Where I'm wrong ?
Thanks for any answers.
20040729 Edit by ysth: use code, p, and br tags instead of pre
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash and it's keys...
by Limbic~Region (Chancellor) on Jul 29, 2004 at 19:52 UTC | |
|
Re: hash and it's keys...
by gaal (Parson) on Jul 29, 2004 at 19:49 UTC | |
|
Re: hash and it's keys...
by ysth (Canon) on Jul 29, 2004 at 19:52 UTC | |
|
Re: hash and it's keys...
by Fletch (Bishop) on Jul 29, 2004 at 19:51 UTC | |
|
Re: hash and it's keys...
by Anonymous Monk on Jul 30, 2004 at 04:59 UTC |