Perl: the Markov chain saw | |
PerlMonks |
Re: Relative Merits of Referencesby johngg (Canon) |
on May 11, 2006 at 14:39 UTC ( [id://548730]=note: print w/replies, xml ) | Need Help?? |
I think that construct is still legal in Perl 5.8.x but you may be falling foul of use strict;. I may be wrong but I suspect that your $h contains a string which is the name of another variable thus setting up a soft reference. The following have been run under Perl 5.8.4 Firstly with no use strict; or use warnings;
produces
Switching on strict like this
produces
because use strict; objects to soft references. Only by switching strict off for the duration of a code block can you use soft references.
produces
I hope this clarifies what might be happening with your "illegal" code. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|