T
ten8ciousb
Sometimes, not always, an attempt to create a new socket connection
fails with this message:
Socket::INET" (perhaps you forgot to load "IO::Socket::INET"?) at
/usr/local/lib/perl5/5.6.1/IO/Socket/INET.pm line 32
Any ideas why or how INET.pm fails saying it can't find new in INET.pm?
The script runs on many servers many times a day, but only fails on one
and generally about the same time of the day. Okay. Seems kind of
obvious that is something specific to the server and the time of day.
But, within the same script there are multiple calls to create sockets
to different servers and they complete successfully.
I'm kind of out of my element on the internals of perl here, but my
thoughts:
Is it trying to find IO::Socket::INET.pm in @INC in order to identify
the super class, which is IO::Socket?
Does that mean that @INC has somehow become 'corrupted' during runtime?
any other thoughts.
Or has perl's symbol table become corrupted so it doesn't know what
"new" is?
nothing fancy in the script:
use IO::Socket;
use IO::Socket::INET;
$sock = IO::Socket::INET->new(
PeerAddr => $host,
PeerPort => $port,
Proto => 'tcp',
);
for reference : in INET.pm:
@ISA = qw(IO::Socket);
....
sub new {
my $class = shift;
unshift(@_, "PeerAddr") if @_ == 1;
return $class->SUPER::new(@_); ### Here's line 32
}
fails with this message:
Socket::INET" (perhaps you forgot to load "IO::Socket::INET"?) at
/usr/local/lib/perl5/5.6.1/IO/Socket/INET.pm line 32
Any ideas why or how INET.pm fails saying it can't find new in INET.pm?
The script runs on many servers many times a day, but only fails on one
and generally about the same time of the day. Okay. Seems kind of
obvious that is something specific to the server and the time of day.
But, within the same script there are multiple calls to create sockets
to different servers and they complete successfully.
I'm kind of out of my element on the internals of perl here, but my
thoughts:
Is it trying to find IO::Socket::INET.pm in @INC in order to identify
the super class, which is IO::Socket?
Does that mean that @INC has somehow become 'corrupted' during runtime?
any other thoughts.
Or has perl's symbol table become corrupted so it doesn't know what
"new" is?
nothing fancy in the script:
use IO::Socket;
use IO::Socket::INET;
$sock = IO::Socket::INET->new(
PeerAddr => $host,
PeerPort => $port,
Proto => 'tcp',
);
for reference : in INET.pm:
@ISA = qw(IO::Socket);
....
sub new {
my $class = shift;
unshift(@_, "PeerAddr") if @_ == 1;
return $class->SUPER::new(@_); ### Here's line 32
}