note
DigitalKitty
Hi [Anonymous Monk].
<br />
<br />
As [Corion] mentioned, you used the anonymous hash syntax, i.e., <code>$name_of_hash = { ... };</code>
<br />
<br />
Assigning a list to a hash variable will result in the key/value pair(s) being created.
<code>
use warnings;
use strict;
my %Cls = qw( P a N b U c );
print %Cls, "\n\n";
while ( my ($k, $v) = each( %Cls ) ) {
print "$k => $v\n";
}
</code>
<br />
<b>Update:</b> Fixed typo by changing <code>%name_of_hash = { ... };</code> to <code>$name_of_hash = { ... };</code> after [ikegami]++ noticed it. Thanks.
<br />
<br />
Hope this helps,
<br />
~Katie
669498
669498