This is not an answer to your question, but rather a related observation. Here's the relevant section of the docs for do (my emphasis):
Uses the value of EXPR as a filename and executes the contents of the file as a Perl script. Its primary use is to include subroutines from a Perl subroutine library.
is just like
except that itís more efficient and concise, keeps track of the current filename for error messages, searches the @INC libraries, and updates %INC if the file is found. … It also differs in that code evaluated with "do FILENAME" cannot see lexi≠cals in the enclosing scope; "eval STRING" does.
eval `cat stat.pl`;
It may not be not entirely obvious, but the underlined sentence implies that, despite the similarity of the two constructs, with do 'stat.pl'
strictures are not enforced, but they are with eval `cat stat.pl`
In the following example, the file x.pl contains only the line $x = 1;
print 'do: ', +( $@ ? $@ : 'ok' ), "\n";
eval `cat x.pl`;
print 'eval: ', +( $@ ? $@ : 'ok' ), "\n";
Variable "$x" is not imported at (eval 2) line 1 (#1)
(F) While "use strict" in effect, you referred to a global variabl
you apparently thought was imported from another module, because
something else of the same name (usually a subroutine) is exported
that module. It usually means you put the wrong funny character o
front of your variable.
eval: Global symbol "$x" requires explicit package name at (eval 2) li
So you'll need to use eval instead of do if you want strictures, but you'll have to check $@ yourself after the eval.