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: Perl Programming Help: Beginner:
Pinging the visitor?

 



Pro_4
User

May 24, 2001, 3:57 PM

Post #1 of 5 (504 views)
Pinging the visitor? Can't Post

hey,

I was wondering if it was possible to ping the visitor, to find out how fast they are connecting with the server and depending on that it will send them to the appropriate page (fast connection users or slow connection users). I know in the command prompt on windows you can type ping 1.1.1.1 and it will ping that ip address. So i was wondering if there was any ping command for perl or if there was a module that can do this. BTW am i posting this in the right area or is this to hard(or easy, if that is the case i put it in the right spot)?

Thanks for the help :)

People Engrossed by a Reliable Language


freddo
User

May 24, 2001, 4:11 PM

Post #2 of 5 (501 views)
Re: Pinging the visitor? [In reply to] Can't Post

Hi [again] Pro4,

here's how to do:

Code
use Net::Ping; 

$p = Net::Ping->new();
$timing = time();
$p->ping("forums.perlguru.com");
print (time() - $timing);

undef($p);

you may wish to check perldoc Net::Ping (i guess there's no need to tell you what to do with time?)

i hope this helps,
freddo

;---
Real programmers´butcher dont understand when they just ask for 3735928559.


Pro_4
User

May 24, 2001, 4:13 PM

Post #3 of 5 (500 views)
Re: Pinging the visitor? [In reply to] Can't Post

Hey thanks alot [again] LOL. I really apreciate it, is Net::Ping apart of the standard set of modules on a server?

:)

People Engrossed by a Reliable Language


freddo
User

May 24, 2001, 4:34 PM

Post #4 of 5 (497 views)
Re: Pinging the visitor? [In reply to] Can't Post

Generally, yes (methinks).

freddo

;---
Real programmers´butcher dont understand when they just ask for 3735928559.


Pro_4
User

May 24, 2001, 4:35 PM

Post #5 of 5 (496 views)
Re: Pinging the visitor? [In reply to] Can't Post

Alrightie cool thanks for the help :)

People Engrossed by a Reliable Language

 
 


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

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