First, that's not your code, because there's a missing } and you have smartquotes instead of real quotes, so it wouldn't compile. I am otherwise ignoring those errors for now as probably an artifact of however you entered your post into the forum. As Fletch said, perldsc will help you; use warnings; use strict; will even help you find which variable you aren't referencing: Global symbol "%VAR1" requires explicit package name (did you forget to declare "my %VAR1"?) at C:\Users\....pl line 35.. Looking, your syntax $VAR1{$name} is looking up the $name key of the non-existent %VAR1 hash; you really want to look at the $name key of the $VAR1 hashref using the syntax $VAR1->{$name} -- and have multiple similar instances throughout. Also, Basic debugging checklist will help you debug your code; strict, warnings, and print statements easily found that problem. Try again, and if you're still having problems, post the full code (including example data and executable code in the same post), and explain the changes that you have made, why you made them.

edit: that will only fix down to the $value loop, where you are trying to extract the $value from the keys of the non-existent subhash of $VAR1->{$name}{$calen}: that is not a hashref, but a scalar value, so you don't need to take the keys or loop over it. With that hint, I'll let you continue to figure out that portion, as well (there are more problems after that; I'm just stopping there for now)


In reply to Re^3: How to loop through hash of hashes and add the values based on condition? by pryrt
in thread How to loop through hash of hashes and add the values based on condition? by Sami_R

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.