in reply to Hash loop debugging.


..... and what is the problem specifically? The sentence needs to be completed.

Replies are listed 'Best First'.
Re^2: Hash loop debugging.
by uni_j (Acolyte) on Apr 27, 2009 at 13:53 UTC
    I have a loop (for each entity in hash '%dep'). Inside that loop I am adding a variable to %dep2. When I print off all values in %dep2, I only have 1 member of the hash. This isn't supposed to happen because %dep has a ton of members in it's hash.
      Let's take it from the top:
      my $mech = WWW::Mechanize->new(); my $stream = HTML::TokeParser->new(\$html); my $streamm = HTML::TokeParser->new(\$htmll); my $streammm = HTML::TokeParser->new(\$htmlll); my %dep; my %dep2; my @coursename; $mech->get($url); $html = $mech->content();

      You need to declare $html, $htmll, etc. prior to initializing $stream, $streamm, etc.
      Fix that first, and update the code.

      Please use strict; It would have caught undeclared variables.

      Also heed the advice at: How do I post a question effectively?