When you provide a list when referencing a hash element, perl assumes you are using old perl4-style emulated nested hashes and produces a single hash key like this: $ClubTotal{"DayOfMonth$;$date"}.
Based on looking at the OP's output from Data::Dumper (and on trying it myself), it seems that perl is not adding any sort of field delimiter in the hash key:
perl -le '$n=0; $h{"foo"=>$n++}=$n for (0..3); print "$_ => $h{$_}" fo
+r (sort keys %h)'
foo0 => 1
foo1 => 2
foo2 => 3
foo3 => 4
That said, I would agree that presence of the "fat comma" (=>) as part of the hash-key expression looks like a misunderstanding (and/or could be misunderstood by less skilled readers), and is rather ugly as well. Something like simple concatenation or string interpolation would be clearer (
$hash{'string'.$num} or
$hash{"string$num"}).
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.