Welcome to the Monastery | |
PerlMonks |
Re: syntax for hashes with variable in nameby jethro (Monsignor) |
on Nov 22, 2010 at 12:47 UTC ( [id://872961]=note: print w/replies, xml ) | Need Help?? |
Your immediate problem is that perl interprets your %{ as a hash slice (see http://docstore.mik.ua/orelly/perl/learn/ch05_05.htm for a small example) Your larger problem is that you want to use a technique that is a relict from perl4 days and only (if at all) suitable for quick hacks Instead of using use multidimensional hashes
You can use the same technique for your arrays as well, i.e. use a so called HashOfArrays:
PS: I also notice you don't use 'use warnings;' and 'use strict;' at the beginning of your script. It is highly advisable to include those two lines. Avoids many bug finding sessions later.
In Section
Seekers of Perl Wisdom
|
|