Category Archives: autovivification

Perl cgi compilation error in autovivication.pm

I'm using a perl cgi script that uses our own libraries, which use the "no autovivification" pragma. E.g.

/usr/lib/company/mysim.cgi:

#!/usr/bin/perl -w

use strict;
# ... other use
use Company::Module1;

/usr/lib/perl5/Company/Module1.pm

package Company::Module1;

no autovivification;
use strict;
use warnings;

Approximately 50% of the time, when accessing the URL to reach the cgi script the compilation fails with...

[Fri Dec 04 15:40:10.744901 2015] [:error] [pid 30455:tid 2961136448] Bareword "A_HINT_STRICT" not allowed while "strict subs" in use at /usr/lib/i386-linux-gnu/perl5/5.20/autovivification.pm line 144.\nBareword "A_HINT_WARN" not allowed while "strict subs" in use at /usr/lib/i386-linux-gnu/perl5/5.20/autovivification.pm line 144.\nBareword "A_HINT_FETCH" not allowed while "strict subs" in use at /usr/lib/i386-linux-gnu/perl5/5.20/autovivification.pm line 144.\nBareword "A_HINT_STORE" not allowed while "strict subs" in use at /usr/lib/i386-linux-gnu/perl5/5.20/autovivification.pm line 144.\nBareword "A_HINT_EXISTS" not allowed while "strict subs" in use at /usr/lib/i386-linux-gnu/perl5/5.20/autovivification.pm line 144.\nBareword "A_HINT_DELETE" not allowed while "strict subs" in use at /usr/lib/i386-linux-gnu/perl5/5.20/autovivification.pm line 144.\nCompilation failed in require at /usr/lib/company/mysim.cgi line 14.\nBEGIN failed--compilation aborted at /usr/lib/company/mysim.cgi line 14.\n

(taken from /var/log/apache2/ssl/error.log as this script sits on the https port).

My environment is: - debian jessie (8.2) - tomcat7 - apache2 (2.4) - perl 5.20.2 - libautovivification-perl 0.12-1+b1

My questions are:

  1. Has anyone seen this before? It seems odd that the autovivification module fails to compile due to a "use strict" pragma.

  2. Can anyone explain the intermittent nature of the compilation error? Even more odd, the cgi fails to compile ~half the time, and works fine (i.e. runs and returns expected results) the other ~half.

Thanks for your time.