diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-10-19 20:37:06 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-10-21 08:42:17 +0200 |
commit | 735631af6fd7ee0a0db0185decce87cabe3eb134 (patch) | |
tree | 8426e00ceac5388b565b31b455909c404c6f0ce6 /ext/Socket | |
parent | 04777d295957ad270188e4debf51b523e07cc5b0 (diff) | |
download | perl-735631af6fd7ee0a0db0185decce87cabe3eb134.tar.gz |
Convert Fcntl, File::Glob, I18N::Langinfo, POSIX and Socket to croak_on_error.
This is possible because all 5 use ExtUtils::Constant::ProxySubs, so the
constant() routine is only used for error conditions.
Diffstat (limited to 'ext/Socket')
-rw-r--r-- | ext/Socket/Makefile.PL | 4 | ||||
-rw-r--r-- | ext/Socket/Socket.pm | 9 |
2 files changed, 4 insertions, 9 deletions
diff --git a/ext/Socket/Makefile.PL b/ext/Socket/Makefile.PL index 043f4823cd..d81a5c34cc 100644 --- a/ext/Socket/Makefile.PL +++ b/ext/Socket/Makefile.PL @@ -1,5 +1,5 @@ use ExtUtils::MakeMaker; -use ExtUtils::Constant 0.11 'WriteConstants'; +use ExtUtils::Constant 0.23 'WriteConstants'; use Config; WriteMakefile( NAME => 'Socket', @@ -72,7 +72,7 @@ push @names, foreach qw(INADDR_ANY INADDR_LOOPBACK INADDR_NONE INADDR_BROADCAST); WriteConstants( - PROXYSUBS => 1, + PROXYSUBS => {croak_on_error => 1}, NAME => 'Socket', NAMES => \@names, ); diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm index 1cffe6b5df..a46d2fec68 100644 --- a/ext/Socket/Socket.pm +++ b/ext/Socket/Socket.pm @@ -1,7 +1,7 @@ package Socket; our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); -$VERSION = "1.90"; +$VERSION = "1.91"; =head1 NAME @@ -435,12 +435,7 @@ sub AUTOLOAD { my($constname); ($constname = $AUTOLOAD) =~ s/.*:://; croak "&Socket::constant not defined" if $constname eq 'constant'; - my ($error, $val) = constant($constname); - if ($error) { - croak $error; - } - *$AUTOLOAD = sub { $val }; - goto &$AUTOLOAD; + constant($constname); } XSLoader::load(); |