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:
Ping fails

 



MDTech.us_MAN
Novice

Mar 4, 2013, 7:52 PM

Post #1 of 3 (268 views)
Ping fails Can't Post

Why does the following statement return "Failed" on my hosting service (http://mdtpages.atspace.cc/ping.cgi) but "Success" on my local computer?


Code
#!/usr/bin/perl 
use CGI;
use IO::Socket::INET;

my $cgi = CGI->new;
print $cgi->header;

$socket = IO::Socket::INET->new("google.com:80");
if ($socket) {
print "Success\n";
} else {
print "Failed\n";
}

close($socket);
# just to be nice.



rovf
Veteran

Mar 5, 2013, 2:55 AM

Post #2 of 3 (265 views)
Re: [MDTech.us_MAN] Ping fails [In reply to] Can't Post

Firewall?


MDTech.us_MAN
Novice

Mar 5, 2013, 6:08 AM

Post #3 of 3 (263 views)
Re: [rovf] Ping fails [In reply to] Can't Post

Good idea! I'll check with my hosting company!

 
 


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

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