summaryrefslogtreecommitdiff
path: root/utils/h2xs.PL
diff options
context:
space:
mode:
Diffstat (limited to 'utils/h2xs.PL')
-rw-r--r--utils/h2xs.PL3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/h2xs.PL b/utils/h2xs.PL
index 800329103a..97d3ceded3 100644
--- a/utils/h2xs.PL
+++ b/utils/h2xs.PL
@@ -486,6 +486,7 @@ sub AUTOLOAD {
my \$constname;
(\$constname = \$AUTOLOAD) =~ s/.*:://;
+ croak "&$module::constant not defined" if \$constname eq 'constant';
my \$val = constant(\$constname, \@_ ? \$_[0] : 0);
if (\$! != 0) {
if (\$! =~ /Invalid/) {
@@ -496,7 +497,7 @@ sub AUTOLOAD {
croak "Your vendor has not defined $module macro \$constname";
}
}
- eval "sub \$AUTOLOAD { \$val }";
+ *\$AUTOLOAD = sub () { \$val };
goto &\$AUTOLOAD;
}