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/I18N-Langinfo | |
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/I18N-Langinfo')
-rw-r--r-- | ext/I18N-Langinfo/Langinfo.pm | 16 | ||||
-rw-r--r-- | ext/I18N-Langinfo/Makefile.PL | 4 |
2 files changed, 4 insertions, 16 deletions
diff --git a/ext/I18N-Langinfo/Langinfo.pm b/ext/I18N-Langinfo/Langinfo.pm index 51d0d4d5b6..48e44ce201 100644 --- a/ext/I18N-Langinfo/Langinfo.pm +++ b/ext/I18N-Langinfo/Langinfo.pm @@ -72,7 +72,7 @@ our @EXPORT_OK = qw( YESSTR ); -our $VERSION = '0.06'; +our $VERSION = '0.07'; sub AUTOLOAD { # This AUTOLOAD is used to 'autoload' constants from the constant() @@ -82,19 +82,7 @@ sub AUTOLOAD { our $AUTOLOAD; ($constname = $AUTOLOAD) =~ s/.*:://; croak "&I18N::Langinfo::constant not defined" if $constname eq 'constant'; - my ($error, $val) = constant($constname); - if ($error) { croak $error; } - { - no strict 'refs'; - # Fixed between 5.005_53 and 5.005_61 -#XXX if ($] >= 5.00561) { -#XXX *$AUTOLOAD = sub () { $val }; -#XXX } -#XXX else { - *$AUTOLOAD = sub { $val }; -#XXX } - } - goto &$AUTOLOAD; + constant($constname); } XSLoader::load(); diff --git a/ext/I18N-Langinfo/Makefile.PL b/ext/I18N-Langinfo/Makefile.PL index 56c3aeeca0..2cc590afae 100644 --- a/ext/I18N-Langinfo/Makefile.PL +++ b/ext/I18N-Langinfo/Makefile.PL @@ -1,5 +1,5 @@ use ExtUtils::MakeMaker; -use ExtUtils::Constant; +use ExtUtils::Constant 0.23; WriteMakefile( 'NAME' => 'I18N::Langinfo', @@ -30,7 +30,7 @@ push @names, # This lot are only enums for __SVR4_I386_ABI_L1__: foreach qw (CRNCYSTR THOUSEP RADIXCHAR); ExtUtils::Constant::WriteConstants( - PROXYSUBS => 1, + PROXYSUBS => {croak_on_error => 1}, NAME => 'I18N::Langinfo', NAMES => \@names, ); |