The latter doesn't work either (it just doesn't issue an error here, 'cos the script is dying after the first problem on line 13).# this will be ok $hash{1}{\@array}{1} = 42; #this will be ok $hash{1}{\@array}{1}{1} = 42;
The reason is simply that if you assign 42 to $hash{\@array}, or $hash{1}{\@array}{1} for that matter, and then try to deference that value in the next statement, you're essentially trying to say
which obviously doesn't make sense."42"->{1} = 42
In reply to Re^2: can't use string as hash ref
by Anonymous Monk
in thread can't use string as hash ref
by spickles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |