diff options
author | Leon Timmermans <fawaka@gmail.com> | 2021-03-20 01:20:15 +0100 |
---|---|---|
committer | James E Keenan <jkeenan@cpan.org> | 2021-06-20 14:21:21 +0000 |
commit | f0e0f25d5ce9118d61837a3d286f5fd2fff7b1a3 (patch) | |
tree | 44482957a72b4ff10e661bb5fdf1c6cac800fe9f /ext/DynaLoader | |
parent | 9ca9236c3891634f51ba22d3ea997c3920cb5006 (diff) | |
download | perl-f0e0f25d5ce9118d61837a3d286f5fd2fff7b1a3.tar.gz |
Make DynaLoader strict-safe
Diffstat (limited to 'ext/DynaLoader')
-rw-r--r-- | ext/DynaLoader/DynaLoader_pm.PL | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL index 002569f98c..863b806d85 100644 --- a/ext/DynaLoader/DynaLoader_pm.PL +++ b/ext/DynaLoader/DynaLoader_pm.PL @@ -73,6 +73,8 @@ print OUT <<'EOT'; # Generated from DynaLoader_pm.PL, this file is unique for every OS +use strict; + package DynaLoader; # And Gandalf said: 'Many folk like to know beforehand what is to @@ -88,9 +90,17 @@ package DynaLoader; # Tim.Bunce@ig.co.uk, August 1994 BEGIN { - $VERSION = '1.50'; + our $VERSION = '1.51'; } +# Note: in almost any other piece of code "our" would have been a better +# option than "use vars", but DynaLoader's bootstrap files need the +# side effect of the variable being declared in any scope whose current +# package is DynaLoader, not just the current lexical one. +use vars qw(@dl_library_path @dl_resolve_using @dl_require_symbols + $dl_debug @dl_librefs @dl_modules @dl_shared_objects + $dl_dlext $dl_so $dlsrc @args $module @dirs $file $bscode); + EOT if (!$ENV{PERL_BUILD_EXPAND_CONFIG_VARS}) { @@ -141,7 +151,7 @@ print OUT expand_os_specific(<<'EOT'); # inefficient to define on systems that don't need it. $Is_VMS = $^O eq 'VMS'; <</$^O-eq-VMS>> -$do_expand = <<$^O-eq-VMS>>1<<|$^O-eq-VMS>>0<</$^O-eq-VMS>>; +my $do_expand = <<$^O-eq-VMS>>1<<|$^O-eq-VMS>>0<</$^O-eq-VMS>>; @dl_require_symbols = (); # names of symbols we need<<$^O-eq-freemint>> @dl_resolve_using = (); # names of files to link with<</$^O-eq-freemint>><<$^O-eq-hpux>> @@ -292,6 +302,8 @@ sub croak { require Carp; Carp::croak(@_) } sub bootstrap_inherit { my $module = $_[0]; + + no strict qw/refs vars/; local *isa = *{"$module\::ISA"}; local @isa = (@isa, 'DynaLoader'); # Cannot goto due to delocalization. Will report errors on a wrong line? |