weezer316 has asked for the wisdom of the Perl Monks concerning the following question:
Sorry, im a bit of a noob, only been learning perl for about a fortnight, so please dont laugh to hard! Basically, Im tyring to write a program that goes off and checks rbl's and then writes the results to an HTML template....but it isnt working on one line!
the rest of it works in isolation. very frustrating
This is the problem!********************* use warnings; use strict; use Net::RBLClient; use HTML::Processor; my @servers = ('213.123.20.134','213.123.20.119','213.123.20.120','213 +.123.20.121','213.123.20.122','213.123.20.123', '213.123.20.124','213.123.20.125','213.123.20.126','213.123.20.127','2 +13.123.20.128','213.123.20.129', '213.123.20.130','213.123.20.131','213.123.20.132'); my %rbl_list = (); foreach my $ip (@servers){ chomp $ip; $ip =~ s/"//i; my $rbl = Net::RBLClient->new; $rbl->lookup($ip); my @listed_by = $rbl->listed_by; $rbl_list{$ip} = \@listed_by; } foreach my $server(values %rbl_list) { $server =~ s//Nothing/gi } my $output = '/root/Documents/animals_output.html'; open(FH1, ">$output"); my $tpl = new HTML::Processor; my $rbl_watch = $tpl->new_loop("blacklists"); foreach my $omr( keys %rbl_list) { $rbl_watch->array("server_ip", $omr); my $blackholes = $tpl->new_loop("listings", $omr); foreach my $type ( @{$rbl_list{$omr}{blackholes} }) { $blackholes->array ("positive_listings", $type);v } } $tpl->variable("what", "Server Status"); print $tpl->process("/root/Documents/animals.html"); close (FH1); ******************************************
I have been told I need to use qw somewhere....where, and how cause i keep getting the following error:foreach my $type ( @{$rbl_list{$omr}{blackholes} }) { $blackholes->array ("positive_listings", $type); }
Dec 21, 2025 at 23:17 UTC McDarren Added code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: help! Please please help!
by Corion (Patriarch) on Mar 14, 2008 at 11:58 UTC | |
by weezer316 (Initiate) on Mar 14, 2008 at 12:46 UTC | |
by Corion (Patriarch) on Mar 14, 2008 at 12:51 UTC | |
by weezer316 (Initiate) on Mar 14, 2008 at 13:01 UTC | |
by amarquis (Curate) on Mar 14, 2008 at 14:29 UTC | |
by amarquis (Curate) on Mar 14, 2008 at 12:56 UTC | |
|
Re: help! Please please help!
by toolic (Bishop) on Mar 14, 2008 at 12:37 UTC | |
|
Re: help! Please please help!
by amarquis (Curate) on Mar 14, 2008 at 12:47 UTC | |
by grinder (Bishop) on Mar 14, 2008 at 13:12 UTC | |
by Fletch (Bishop) on Mar 14, 2008 at 14:15 UTC | |
by amarquis (Curate) on Mar 14, 2008 at 14:32 UTC | |
|
Re: help! Please please help!
by McDarren (Abbot) on Mar 14, 2008 at 18:45 UTC |