in reply to crazy hashes

One thing to note is that the "funky line" has a bug. You're using a hash variable as a reference (the %Bad_Host_Rows->{dirname($row[1])} part. Changing this part to $Bad_Host_Rows{$row[1]} will probably fix your problem.

Recent versions of Perl complain about this problem.

Arjen

Replies are listed 'Best First'.
Re: Re: crazy hashes
by datannen (Novice) on May 25, 2004 at 14:09 UTC
    push @{$Bad_Host_Rows{dirname($row[1])}{$row[0]}}, [@row];
    Changed it to the above and still getting the same results.
    
    More Info:
    After I push all the data onto the hash, I return it using:
    
    return (bless (\%Bad_Host_Rows));
    and retrieve it by using:
    $badrows = $base->get_Bad_Rows(qw/host request fulldatetime/);
    
    
    Then using these lines:
    %hasher = %{$badrows}; print Dumper(\%hasher);
    Thanks again for your help.
      You get a perfectly good hash reference back from get_Bad_Rows(). Why copy it into another hash and then display that?
      $badrows = $base->get_Bad_Rows(qw/host request fulldatetime/); print Dumper($badrows);
      works fine.

      Arjen

        no reason. 
        
        I did some more testing and the hash gets filled properly.  The problem happens when I send it back via:
        
        return (bless (\%Bad_Host_Rows));
        
        and retrieve it using:
        
        $badrows = $base->get_Bad_Rows(...)
        
        are these lines bad?