mod_perl uses runtime loading of classes so I suspect that X being declared in a BEGIN block may be the problem. Since constants are declared via 'use constant ...', doing that inside a BEGIN block shouldn't be needed.
However, without some sample code, it's difficult to do any analysis.