@hash{'one'} = "123" does work, but is better said as $hash{'one'} = "123".
$key = keys... is calling keys in a scalar context (asking for only one value). keys is documented to return the number of keys in the hash in this case. Say foreach my $key (keys %hash) instead, or while (my $key = each %hash).
In reply to Re: hash and it's keys...
by ysth
in thread hash and it's keys...
by stan2004
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |