in reply to map and each?
When called in list context, returns a 2-element list consisting of the key and value for the nextelement of a hash, so that you can iterate overit. When called in scalar context, returns only the key for the next element in the hash.
This approxomates the functionality that you display above (key = value<br>key = value<br> etc. all in one string) without the error.my $joined; foreach my $key ( keys( %hash ) ) { $joined .= "$key = $hash{$key}<br>"; }
|
|---|