|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re: Adding Hash Keys/Valuesby kennethk (Monsignor) |
| on Nov 08, 2012 at 15:57 UTC ( #1002936=note: print w/ replies, xml ) | Need Help?? |
|
The answer to your immediate issue is that you need to use double quotes instead of single quotes if you want a variable value to interpolate into a string. Your line should therefore read $table_hash{"$n,0"} = $m;. See Quote and Quote like Operators in perlop. You are using compound keys to emulate a multidimensional array in your code, which is very Perl 4. With the addition of array references (a couple decades ago), I would do this with something like:
See perlreftut. #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||