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 22, 2025 at 05:33 UTC McDarren Added code tags
In reply to help! Please please help! by weezer316
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |