Now that you have got the mandatory advices, let's see:
my %hash={}Apart from the missing semicolon at the end of this line, the statement is faulty because you define a hash "%hash" and assign to it a hash reference {}! In order to initialize an empty hash you can simply use my %hash; or my %hash=(); assigning to it an empty list.
$hash{ONE}='malay';This one is good, assigns to the element "ONE" of the hash %hash.
$hash->{TWO}='manab';This one is less good, tries assigning to the element "TWO" of the hash reference $hash which is undefined.
Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."
In reply to Re: hash Querry
by psini
in thread hash Querry
by perlplayer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |