Answer the question
In order to leave comments, you need to log in
Why does a syntax error occur when trying to initialize a hash using a variable?
When trying to initialize the hash like this
$h{a} = "1";
$h{b} = "2";
syntax error at p.pl line 93, near "$h{"
syntax error at p.pl line 94, near "$h{"
$h->{a} = "1";
$h->{b} = "2";
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question