Don't ask to ask, just ask | |
PerlMonks |
Array of hashes reference problemby tlemons (Novice) |
on Jun 22, 2005 at 17:25 UTC ( [id://469104]=perlquestion: print w/replies, xml ) | Need Help?? |
tlemons has asked for the wisdom of the Perl Monks concerning the following question:
Hi I'm using the following code to process lines in the $discovered array, and create a number of hashed pairs in the same array row. The code works well.
But, when I enabled 'use strict' in my code, I get the following error when the line containing '$arrayAoH[$j]{$key} = $value;' is executed: "Can't use string ("") as a HASH ref while "strict refs" in use at xxx.pl" I've pored over the examples in 'Programming Perl', and have Google'd a bit. But I just don't understand why that line is wrong, and what I should do to fix it. I tried using the following line in place of the offending line:
but it creates an array row with only a single has (whatever the last has processed was). Thoughts, please! Thanks tl 20050623 Edit by ysth: code tags
Back to
Seekers of Perl Wisdom
|
|