diff options
author | Larry Wall <lwall@netlabs.com> | 1995-03-12 22:32:14 -0800 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1995-03-12 22:32:14 -0800 |
commit | 748a93069b3d16374a9859d1456065dd3ae11394 (patch) | |
tree | 308ca14de9933a313dceacce8be77db67d9368c7 /ext/Socket | |
parent | fec02dd38faf8f83471b031857d89cb76fea1ca0 (diff) | |
download | perl-748a93069b3d16374a9859d1456065dd3ae11394.tar.gz |
Perl 5.001perl-5.001
[See the Changes file for a list of changes]
Diffstat (limited to 'ext/Socket')
-rw-r--r-- | ext/Socket/Socket.pm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm index 8e6e097c0c..6c63fb5fe3 100644 --- a/ext/Socket/Socket.pm +++ b/ext/Socket/Socket.pm @@ -86,10 +86,6 @@ require DynaLoader; ); sub AUTOLOAD { - if (@_ > 1) { - $AutoLoader::AUTOLOAD = $AUTOLOAD; - goto &AutoLoader::AUTOLOAD; - } local($constname); ($constname = $AUTOLOAD) =~ s/.*:://; $val = constant($constname, @_ ? $_[0] : 0); @@ -107,6 +103,16 @@ sub AUTOLOAD { goto &$AUTOLOAD; } + +# pack a sockaddr_in structure for use in bind() calls. +# (here to hide the 'S n C4 x8' magic from applications) +sub sockaddr_in{ + my($af, $port, @quad) = @_; + my $pack = 'S n C4 x8'; # lookup $pack from hash using $af? + pack($pack, $af, $port, @quad); +} + + bootstrap Socket; # Preloaded methods go here. Autoload methods go after __END__, and are |