#!/usr/bin/perl -wT # Specify Perl modules use Time::localtime; use Net::Ping; use LWP::UserAgent; # Define base scalars my $time = localtime; my $targurl = 'http://wwwsomesite/somefile.html'; my $targhost = 'www.somesite'; my $agent = 'Mozilla/4.5 [en] (X11; I; Linux 2.0.36 i486; Nav)'; my $raw = '/tmp/tempfile'; my $out = '/var/www/outfile.txt'; my $pl = 'thisfilename.pl'; my $desturl = 'http://thiswebserver.org'; # Gen log header printf " thisfile.pl : %02d-%02d-%04d %02d:%02d:%02d\n", $time->mon+1, $time->mday, $time->year+1900, $time->hour, $time->min, $time->sec; print " thisfile.pl : target - $targurl \n"; print " thisfile.pl : agent - $agent \n"; print " thisfile.pl : patience, the next two steps may take some time\n"; # Ping host to make sure it's accessible $p = Net::Ping->new( "icmp" ) or die " thisfile.pl : Can't create new Net::Ping object: $!\n";%0