in reply to require error message

I'd try

% perl -wc file.pl
or, if you want more verbose error messages,
% perl -Mdiagnostics -wc file.pl
from the command line. This will do a syntax check on file.pl without running it. It should print out the errors and warnings to stderr.

the lowliest monk