Subject: | Bug in t/99moduniqgen |
Distribution name and version: Apache-Session-1.54
Perl version: 5.005_03
OS: Linux montreal 2.2.14-5.0smp #1 SMP Tue Mar 7 21:01:40 EST 2000 i686 unknown
Description:
I was attempting to install Apache::Session using CPAN. I got the following results during make test:
[root@montreal Apache-Session-1.54]# make test
PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.00503/i686-linux -I/usr/lib/perl5/5.00503 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/99base64.........ok
t/99dbfile.........ok
t/99dbfilestore....ok
t/99file...........ok
t/99filelock.......ok
t/99filestore......ok
t/99flex...........ok
t/99md5gen.........ok
t/99moduniqgen.....String found where operator expected at blib/lib/Apache/Session/Generate/ModUniqueId.pm line 11, near "&Carp::croak 'Can\'t get UNIQUE_ID env variable. Make sure mod_unique_id is enabled.'"
(Missing operator before 'Can\'t get UNIQUE_ID env variable. Make sure mod_unique_id is enabled.'?)
syntax error at blib/lib/Apache/Session/Generate/ModUniqueId.pm line 11, near "&Carp::croak 'Can\'t get UNIQUE_ID env variable. Make sure mod_unique_id is enabled.'"
BEGIN failed--compilation aborted at t/99moduniqgen.t line 1.
t/99moduniqgen.....dubious
Test returned status 255 (wstat 65280, 0xff00)
t/99nulllock.......ok
t/99semaphore......ok
t/99storable.......ok
t/99uue............ok
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/99moduniqgen.t 255 65280 ?? ?? % ??
Failed 1/18 test scripts, 66.67% okay. 0/97 subtests failed, 100.00% okay.
make: *** [test_dynamic] Error 11
This appears to be related to the require Carp statement in line 11:
1 package Apache::Session::Generate::ModUniqueId;
2
3 use strict;
4 use vars qw($VERSION);
5 $VERSION = '0.01';
6
7 sub generate {
8 my $session = shift;
9 unless (exists $ENV{UNIQUE_ID}) {
10 require Carp;
11 Carp::croak 'Can\'t get UNIQUE_ID env variable. Make sure mod_unique_id is enabled.';
12 }
13 $session->{data}->{_session_id} = $ENV{UNIQUE_ID};
14 }
Replacing require with use in line 11 eliminated the problem.
[root@montreal Apache-Session-1.54]# make test
PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.00503/i686-linux -I/usr/lib/perl5/5.00503 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/99base64.........ok
t/99dbfile.........ok
t/99dbfilestore....ok
t/99file...........ok
t/99filelock.......ok
t/99filestore......ok
t/99flex...........ok
t/99md5gen.........ok
t/99moduniqgen.....ok
t/99nulllock.......ok
t/99semaphore......ok
t/99storable.......ok
t/99uue............ok
All tests successful.
Files=18, Tests=100, 1 wallclock secs ( 1.20 cusr + 0.14 csys = 1.34 CPU)
Thanks,
Chris