Appy16 has asked for the wisdom of the Perl Monks concerning the following question:
Checking Part here refers to the part where the status of URL is checked.
Kindly Help. Thanx in advance.#!/usr/bin/perl use warnings; use LWP::Simple; require LWP::UserAgent; use Tie::File; my $testfolder = "/Users/Appy/Desktop/"; tie @file, 'Tie::File', $testfolder . "testfile.txt" or die; print "$file[1]\n"; untie @file; my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; my $response = $ua->get($file[1]); if ($response->is_success) { print "The URL is active.\n"; } else { print "The URL is Inactive.\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl copy Text from file to Script
by almut (Canon) on Mar 22, 2010 at 08:37 UTC | |
by Appy16 (Sexton) on Mar 22, 2010 at 08:53 UTC | |
by almut (Canon) on Mar 22, 2010 at 09:00 UTC | |
|
Re: Perl copy Text from file to Script
by Utilitarian (Vicar) on Mar 22, 2010 at 10:30 UTC |