Odd effect with local package with mod_perl and registry
08:29 12 Mar 2026

I have a Perl script that runs fine from the command line, but when run within Perl Registry (Apache), I get errors like

Bareword "XYZ" not allowed while "strict subs"

I've identified two cases when this happens so far:

  1. When defining a constand XYZ, then defining an inline-package, and finally reverting to package mail: Then XYZ is not known any more.

  2. When the inline-package wants to access a global constant via main::XYZ or ::XYZ

So it seems the package scope is different under mod_perl.

apache package cgi mod-perl-registry