http://www.perlmonks.org?node_id=852384

sflitman has asked for the wisdom of the Perl Monks concerning the following question:

I've been getting these messages in my Apache error_log for several weeks. The perl script is perfectly happy, no warnings with strict and when checking with perl -wc and the web service seems to be running well. The server itself has been up for more than 600 days, it is running Fedora Core 7 (I'm afraid of upgrading when it is a production server and the client is happy), Apache 2.2.8, and Mod_perl recently upgraded from 2.0.3 to 2.0.4 without change in status other than response time is definitely more brisk with 2.0.4.
[17:43:26] (eval 1105): Bareword found where operator expected at (eva +l 1105) line 1, near "${ModPerl::ROOT::ModPerl::Registry::home_admin_ +www_mail_2efcgi}::app" [17:43:26] (eval 1105): (Missing operator before ::app?)
The best I can come up with is that this has something to do with the launching mechanism in ModPerl::Registry which is running an unmodified 'use CGI' script for me (called mail.fcgi). Here's my Apache perl.conf
LoadModule perl_module modules/mod_perl.so #PerlSwitches -w -- when turned on I get Use of uninitialized... war +nings in the log, but the error happens when it is off #PerlSwitches -T -- universal Taint checking is slow... <Files *.fcgi> SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI </Files>
Many other ModPerl::Registry scripts run as part of the service, but only this one reports the bareword error. Yet it itself runs very well (more than 2000 invocations per day). I'm not sure how to attack the problem, or whether any of my Perlmonk Brothers or Sisters have in fact seen it themselves? Any and all comments are welcome.

Thanks in advance,

SSF

Replies are listed 'Best First'.
Re: mod_perl bareword error
by ysth (Canon) on Aug 02, 2010 at 01:46 UTC
      eval 1105, not line 1105. And it's apparently something like
      >perl -we"${foo::bar}::baz = 1;" Bareword found where operator expected at -e line 1, near "${foo::bar} +::baz" (Missing operator before ::baz?) syntax error at -e line 1, near "${foo::bar}::baz " Execution of -e aborted due to compilation errors.
      If you think it can help your thought process:
      .... 1102 $sender=~s/\b$P{username}(?!@)//ig; 1103 $sender=~s/\b$P{email}\b//ig if defined $P{email}; 1104 map { $sender=~s/\b$_\b//ig } grep { $aliases{$_} eq $P{ +username} } keys %aliases; 1105 $sender=~s/,\s*,/,/g; 1106 $sender=~s/,\s*$//; 1107 $sender||=$P{username}; ....
      But I should point out that the error is for an eval, and line 1 of that eval, so it is really being emitted by ModPerl::Registry

      SSF

Re: mod_perl bareword error
by Anonymous Monk on Aug 02, 2010 at 02:07 UTC
    The best I can come up with is that this has something to do with the launching mechanism in ModPerl::Registry which is running an unmodified 'use CGI' script for me (called mail.fcgi)

    Unmodified? Have you read http://perl.apache.org/docs/1.0/guide/porting.html?

      Thank you for the link. I have used these methods, so it has in fact been modified, but is still conformant to CGI. The principle differences are being careful what to put in the BEGIN block and adding |=1

      SSF