"cPanelUserConfig ..."
I don't really want to harp on cPanelUserConfig. Here's a few quick notes:
-
I wasn't suggesting cPanelUserConfig was a problem; it was an unknown, so therefore a possible culprit.
-
I followed your "cPanel" link.
It seems that I'd need to create an account to learn more about cPanelUserConfig
(or search the web for an unofficial copy).
I wasn't prepared to do either, so it remains an "unknown" for me.
-
cPanelUserConfig may be a handy shortcut, which is fine; however,
your use of the lib pragma shows that you already know how to manipulate @INC,
so it's not quite as absolutely essential as you may think.
-
I'd aim to move from "... pretty sure this is not the cause ..."
to "... 100% certain this is not the cause ...".
"As both strict and warnings operate for all the block regardless of where they are declared, ..."
No, that's incorrect. Here's a handful of examples that I threw together to demonstrate:
$ perl -e 'BEGIN { $x = 1 } use strict;'
$ perl -e 'use strict; BEGIN { $x = 1 }'
Global symbol "$x" requires explicit package name (did you forget to d
+eclare "my $x"?) at -e line 1.
BEGIN not safe after errors--compilation aborted at -e line 1.
$ perl -e 'local $x; use strict;'
$ perl -e 'use strict; local $x;'
Global symbol "$x" requires explicit package name (did you forget to d
+eclare "my $x"?) at -e line 1.
Execution of -e aborted due to compilation errors.
$ perl -e 'use strict; local $x; no strict "vars";'
Global symbol "$x" requires explicit package name (did you forget to d
+eclare "my $x"?) at -e line 1.
BEGIN not safe after errors--compilation aborted at -e line 1.
$ perl -e 'use strict; no strict "vars"; local $x;'
$
"... the error reports it as being in File ..."
Actually, the error reports ".../IO/File.pm"
which is the core module IO::File.
I seem to recall that you were stuck with a fairly early version of Perl by your ISP;
although, I do think IO::File would have been available in whatever early version that was:
$ corelist IO::File
Data for 2022-05-27
IO::File was first released with perl 5.00307
"... which is used by PDF::API2 and not called by my script anywhere else."
You don't necessarily need to have a "use IO::File;" statement. Consider these two:
$ perl -E 'print("Hello, world!\n"); say $INC{"IO/File.pm"};'
Hello, world!
$ perl -E 'STDOUT->print("Hello, world!\n"); say $INC{"IO/File.pm"};'
Hello, world!
/home/ken/perl5/perlbrew/perls/perl-5.36.0/lib/5.36.0/cygwin-thread-mu
+lti/IO/File.pm
"... will look at the other things you suggest a little later ..."
You might also like to try Carp::Always to get verbose backtraces.
It can produce a lot of output,
but could be a quick way to track down the source of the "Insecure dependency ..." message.
Good luck with your troubleshooting. :-)