# from 5.6.1's Socket.pm on Linux 2.4 sub AUTOLOAD { my($constname); ($constname = $AUTOLOAD) =~ s/.*:://; my $val = constant($constname, @_ ? $_[0] : 0); if ($! != 0) { my ($pack,$file,$line) = caller; croak "Your vendor has not defined Socket macro $constname, used"; } eval "sub $AUTOLOAD () { $val }"; goto &$AUTOLOAD; }