Dwakus has asked for the wisdom of the Perl Monks concerning the following question:
I have a script that does something like this:
${%$Hash_reference}{$values[0]} = \@values;
When I attempt to run it locally (where I have Perl 5.10.1) it gives me a "Can't use string as a HASH ref while "strict refs" in use" error. It's apparently converting the hash reference to a string giving me values like "0" or "6/16".
The part that confuses me is that it runs fine on the server. The only difference that I've been able to find is that the server appears to be using Perl 5.8.9. I tried looking through the version deltas to see what could have caused the incompatibility but couldn't find anything.
I'd appreciate any advise on what changes might have caused this problem, and what the best way would be to fix the script to work correctly in both versions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash dereference breaks from 5.8.9 to 5.10.1
by ikegami (Patriarch) on Dec 06, 2011 at 20:48 UTC | |
by Dwakus (Initiate) on Dec 06, 2011 at 21:04 UTC | |
|
Re: Hash dereference breaks from 5.8.9 to 5.10.1
by SuicideJunkie (Vicar) on Dec 06, 2011 at 20:17 UTC | |
|
Re: Hash dereference breaks from 5.8.9 to 5.10.1
by jwkrahn (Abbot) on Dec 06, 2011 at 20:19 UTC |