in reply to Multidimensional hashes
... and since you are using *array references* instead of arrays, you dont really need @c_griph, @b_griph, (and the rest) to begin with. You can save yourself a lot of keystrokes, potential bugs, (and hassle if you later need to add @z_griph, @zzz_griph and so forth) if you just use ...
@griph_keys = qw( c b f o r m y g p w); @griph{@griph_keys} = (); $griph{f} = ['foo','faa']; $griph{c} = ['coo','caa']; $griph{b} = ['bee','baa']; $griph{r} = ['ree','raa']; use Data::Dumper; print(Dumper(\%griph));
... hope that make sense.
|
|---|