in reply to Re^2: help! Please please help!
in thread help! Please please help!

Maybe you can tell us what line 39 is?

If you want people to easily check your code, please edit your above node and put your code in between <code>...</code> tags. That way, it will render and download nicely for everybody.

It also often helps to supply example data with the program, or to reduce the program so it doesn't need any external data anymore yet still reproduces the problem.

As for your concrete problem, you seem to be confused about the data structure you have. The line

foreach my $type ( @{$rbl_list{$omr}{blackholes} })

tries to access the values in %rbl_list as a hash, but before that, you filled it with references to arrays. I find that using Data::Dumper often helps to visualize the data structure and to find where my assumptions about the data structure do differ from reality.

Replies are listed 'Best First'.
Re^4: help! Please please help!
by weezer316 (Initiate) on Mar 14, 2008 at 13:01 UTC
    Corion,
    That line you mentioned is line 39!

    Right, ill have a go with data::dumper and see where it gets me.

    Im still confused though, i thought I was refereing to a line in hash, which had the IP's as the keys and the results stored in an array, as there might me more than one and I needed to refer to them serperatly. Or do I have the worng end of the stick there?

    Cheers

      Net::RBLClient's listed_by() method returns a list of servers blocking an IP. You assign this to an array, and assign a reference to that array to an element of your hash. If you want to iterate over that array, you can just use something like the following instead of your foreach:

      #This line isn't needed anymore #my $blackholes = $tpl->new_loop("listings", $omr); for my $server ( @{$rbl_list{$omr}} ) { #do something for each server in the array }