----- Original Message -----
From: "Chris" <[EMAIL PROTECTED]>
To: "Win32 Perl Users" <[EMAIL PROTECTED]>
Sent: Monday, January 21, 2002 2:08 PM
Subject: RE: Quick PING question


> Thank you to ALL who answered....
>
> Here I was trying to reinvent the wheel! ;-)
>
> Ok, here's another one for you...  Can I, from command line
> run a "hit" to a web site, and report the results back to a
file,
> and NOT to the browser?
>
> It seems that the PING thing saved so much typing that they
want
> me to try to do the same for some Web Sites.
>
> The results would NOT be a complete web page, but like a 404
type error,
> and capture that out put, or (as one site has) a simple "You
made it!"
> text...
>
> If not, I have a lot of web sites I have to hit to verify that
they are
> still up..
>
> These are internal for a place I work at, and they are looking
for sites
> that
> we should not be able to hit (a 404) or give the site test
page ("You
> made it!")
>
> Unfortunately, the "You made it!" is not static, and I can get
one of
> about 500
> different results, but all within one to five lines.
>
> TIA!
>
> Chris
You could try:
#!/usr/bin/perl -w

use strict;
use LWP::Simple;

$url = 'http://www.yoursite.com';            #change
if (get($url)) { print "$url is available\n"; }
else { print "$url is not available\n"; }

If you want timing, then you can use Time::Hires to find out how
long it took to get the results.

ego
Edward G. Orton, GWN Consultants Inc.
Phone: 613-764-3186, Fax: 613-764-1721
email: [EMAIL PROTECTED]

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to