diff options
Diffstat (limited to 'ext/GDBM_File')
-rw-r--r-- | ext/GDBM_File/GDBM_File.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/GDBM_File/GDBM_File.pm b/ext/GDBM_File/GDBM_File.pm index 75bc7c118c..63225f0362 100644 --- a/ext/GDBM_File/GDBM_File.pm +++ b/ext/GDBM_File/GDBM_File.pm @@ -67,8 +67,9 @@ sub AUTOLOAD { ($constname = $AUTOLOAD) =~ s/.*:://; my ($error, $val) = constant($constname); Carp::croak $error if $error; - eval "sub $AUTOLOAD { $val }"; - goto &$AUTOLOAD; + no strict 'refs'; + *{$AUTOLOAD} = sub { $val }; + goto &{$AUTOLOAD}; } XSLoader::load 'GDBM_File', $VERSION; |