I am porting a Perl application from a Windows 2005/IIS host to RHEL 6.5/Apache. In the course of the port we are also upgrading from ActiveState Perl 5.8 to Perl 5.10.
One of the tools that runs as part of the app uses the Perl DateTime library. This library is, dependent on the Params::Validate library by the same author. Both of these libraries are up to date:
[dcoleman@test1-cm3 perl]$ sudo cpanm DateTime DateTime is up to date. (1.18) [dcoleman@test1-cm3 perl]$ sudo cpanm Params::Validate Params::Validate is up to date. (1.18)
Our use of the DateTime library is pretty straight forward:
my $dtNow = DateTime->now;
But that's where the fun starts. Where the code running in ActiveState Perl 5.8 on Windows has run fine for years, since I ported the code I get the following when attempting to load that DateTime library:
Software error: Bareword "SCALAR" not allowed while "strict subs" in use at /var/www/l +ib/perl/DateTime/Duration.pm line 17. Bareword "SCALAR" not allowed while "strict subs" in use at /var/www/l +ib/perl/DateTime/Duration.pm line 17. Bareword "SCALAR" not allowed while "strict subs" in use at /var/www/l +ib/perl/DateTime/Duration.pm line 17. Bareword "SCALAR" not allowed while "strict subs" in use at /var/www/l +ib/perl/DateTime/Duration.pm line 17. Bareword "SCALAR" not allowed while "strict subs" in use at /var/www/l +ib/perl/DateTime/Duration.pm line 17. Bareword "SCALAR" not allowed while "strict subs" in use at /var/www/l +ib/perl/DateTime/Duration.pm line 17. Bareword "SCALAR" not allowed while "strict subs" in use at /var/www/l +ib/perl/DateTime/Duration.pm line 17. Bareword "SCALAR" not allowed while "strict subs" in use at /var/www/l +ib/perl/DateTime/Duration.pm line 17. Compilation failed in require at /var/www/lib/perl/DateTime.pm line 10 +. BEGIN failed--compilation aborted at /var/www/lib/perl/DateTime.pm lin +e 10. Compilation failed in require at /var/www/lib/perl/JobQJob.pm line 36. BEGIN failed--compilation aborted at /var/www/lib/perl/JobQJob.pm line + 36. Compilation failed in require at /var/www/admin/cgi-bin/pushlive.pl li +ne 27. BEGIN failed--compilation aborted at /var/www/admin/cgi-bin/pushlive.p +l line 27. For help, please send mail to the webmaster (root@localhost), giving t +his error message and the time and date of the error.
The DateTime::Duration module where the problem is showing up looks like:
package DateTime::Duration; use strict; use Params::Validate qw( validate SCALAR ); . . . sub new { my $class = shift; my %p = validate( @_, { years => { type => SCALAR, default => 0 } +, months => { type => SCALAR, default => 0 } +, weeks => { type => SCALAR, default => 0 } +, days => { type => SCALAR, default => 0 } +, hours => { type => SCALAR, default => 0 } +, minutes => { type => SCALAR, default => 0 } +, seconds => { type => SCALAR, default => 0 } +, end_of_month => { type => SCALAR, default = +> 'wrap' }, } ); . . .
The problem appears to be identical to the issue at http://www.perlmonks.org/?node_id=855574 but it looks like the discussion under that issue just got dropped before there was any resolution.
Has anyone encountered this before? Any ideas what the cause/resolution might be? What other information can I provide?
Thanks in advance.
DennisIn reply to DateTime::Duration - bareword SCALAR not allowed by dgcoleman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |