You need to take a look at
perlref, if you want to use a hash reference (
my $hash = {};). Since you say you don't want to do that, you need to get rid of the dereferencing arrows in your
push line.
Try this instead:
push @{$hash{$1}{$2}}, $try->param($string);
The arrows are only necessary to tell Perl that you want at data stored in the hash pointed to by the scalar $hash. Since you want at a scalar stored in %hash, you don't need the arrow. (Yes, using a HoHoL makes you use more punctuation, but I think you get the drift.)
Remember, the punctuation on the front of the variable name tells you want kind of value you want to use in that case -- it's not part of the variable's name. The arrow helps distinguish between a scalar portion of a hash and a scalar hash (de)reference. (Does this make it clear? I'm not sure I would understand it if I had to read what I'd just written. :| )
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.