Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The permission of the script file is 755, and the path of the file is /var/www/cgi-bin/test_socket.pl#!/usr/bin/perl use strict; use warnings; use IO::Socket; my $pop3 = IO::Socket::INET->new( PeerAddr => "pop3.163.com", PeerPort => 110, Proto => 'tcp', Timeout => 20 ); print "Content-type: text/html\n\n"; print "Result: "; print $pop3;
When I run the script in command line. It print the result:
But I run it in apache by the URL: http://192.168.0.200/cgi-bin/test_socket.pl . It only print:Content-type: text/html Result: IO::Socket::INET=GLOB(0x9314838)
It seem that the value of the $pop3 is undef. So the use of IO::Socket is failed on apache.Content-type: text/html Result:
Why have this problem. How can I get the rignt result?
DuanXuepeng.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IO::Socket error in CGI on apache
by gellyfish (Monsignor) on May 25, 2006 at 08:11 UTC | |
by Anonymous Monk on May 25, 2006 at 08:22 UTC |