CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
program to check the availability of a URL(secure https://....)

 



amal_ik
New User

Dec 3, 2007, 2:30 PM

Post #1 of 2 (4181 views)
program to check the availability of a URL(secure https://....) Can't Post

hi all,

I am new to perl. I want a program to show the avaliability or reachability of a secure site (internal). currently am using a VB script for that but it is working fine only with http:// sites and gives bad results for https://... sites. Can i push the out put of the program to a notepad ? please help me....


Kanji
User / Moderator

Dec 7, 2007, 12:23 AM

Post #2 of 2 (4165 views)
Re: [amal_ik] program to check the availability of a URL(secure https://....) [In reply to] Can't Post


Code
#!perl 

use strict;
use warnings;

use LWP::UserAgent;

my $browser = LWP::UserAgent->new;
$browser->timeout(10);

foreach my $url (@ARGV)
{
my $response = $browser->get($url);

printf "%s: %s\n",
$url,
$response->is_success ? "OK" : $response->status_line;
}

--k.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives