in reply to Re: can't use string as hash ref
in thread can't use string as hash ref
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: can't use string as hash ref
by spickles (Scribe) on Oct 25, 2010 at 15:46 UTC |