my($constname);
($constname = $AUTOLOAD) =~ s/.*:://;
my $val = constant($constname, @_ ? $_[0] : 0);
Which is the beginning of the AutoLoad function in Socket6.pm
sub AUTOLOAD {
my($constname);
($constname = $AUTOLOAD) =~ s/.*:://;
my $val = constant($constname, @_ ? $_[0] : 0);
if ($! != 0) {
if ($! =~ /Invalid/) {
$AutoLoader::AUTOLOAD = $AUTOLOAD;
goto &AutoLoader::AUTOLOAD;
}
else {
my ($pack,$file,$line) = caller;
croak "Your vendor has not defined Socket macro $constname, us
+ed";
}
}
eval "sub $AUTOLOAD { $val }";
goto &$AUTOLOAD;
}
This also has the effect of taking memory away from the machine until it runs out, a good way to starve the machine if you need to do that I suppose. But definitely not what I would like to have happen.
|