summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbscan <10503608+bscan@users.noreply.github.com>2024-08-19 21:31:39 -0400
committerGitHub <noreply@github.com>2024-08-19 21:31:39 -0400
commite860da27220db922824499462f8588960e770cae (patch)
tree08d7f66cd16dd7d0a8643ddb3d35354c87a4c6f7
parent5b88333ea26119255964dde79d207df1ef548e49 (diff)
parent5027701b08de97f7ddb6b5e695ba62d04231d504 (diff)
downloadPerlNavigator-e860da27220db922824499462f8588960e770cae.zip
Merge pull request #135 from oalders/namespace-autoclean-import
Fix warnings via namespace::autoclean
-rw-r--r--server/src/perl/Inquisitor.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/src/perl/Inquisitor.pm b/server/src/perl/Inquisitor.pm
index 1638683..960f6f3 100644
--- a/server/src/perl/Inquisitor.pm
+++ b/server/src/perl/Inquisitor.pm
@@ -16,12 +16,17 @@ $SIG{__WARN__} = sub { warn '=PerlWarning=', @_ };
# These modules can cause issues because they wipe the symbol table before we get a chance to inspect it.
# Prevent them from loading.
# I hope this doesn't cause any issues, perhaps VERSION numbers or import statements would help here
+#
+# See https://perldoc.perl.org/perldelta#Calling-the-import-method-of-an-unknown-package-produces-a-warning
+# for a discussion of why the stub imports are necessary as of Perl 5.40
$INC{'namespace/clean.pm'} = '';
$INC{'namespace/autoclean.pm'} = '';
{
no strict 'refs';
*{'namespace::autoclean::VERSION'} = sub { '0.29' };
*{'namespace::clean::VERSION'} = sub { '0.27' };
+ *{'namespace::autoclean::import'} = sub { };
+ *{'namespace::clean::import'} = sub { };
}
CHECK {