"Daniel E. Weber" <[EMAIL PROTECTED]> writes:
> I am having trouble with the robot/rules-dbm test, particularly test #8. This
> only occurrs with perl-5.6.1, and not perl-5.6.0. I'm running under Redhat Linux
> 6.2 and both 5.6.0 and 5.6.1 pass all of the installation tests (of perl
> itself).
>
> Under perl-5.6.1 only, I get the following messages when running TEST -v:
>
> > ok 7
> > *** Dump of database ***
> > www.aas.no|exp 1028655617; Tue Aug 6 12:40:17 2002
> > |ua-name| myrobot
> > www.aas.no|vis 3; 997119628; Mon Aug 6 12:40:28 2001
> > www.sn.no|vis 1; 997119618; Mon Aug 6 12:40:18 2001
> > ******
> > not ok 8
>
> Test 8 is the test where an attempt is made to open the database with a
> different agent name - MOMSpider instead of myrobot.
>
> So what exactly is going on here? Am I correct in assuming that the call to
> "no_visits" should return 0 because the user agent name has changed? If so, then
> why is the new W:R:AnyDBM_File not recognizing the name change under 5.6.1 but
> working properly under 5.6.0?
I don't know. The code that tries to clear the file is:
unless ($old && $old eq $newname) {
# Old info is now stale.
my $file = $self->{'filename'};
untie %{$self->{'dbm'}};
tie %{$self->{'dbm'}}, 'AnyDBM_File', $file, O_TRUNC|O_RDWR, 0640;
$self->{'dbm'}{"|ua-name|"} = $newname;
}
in the 'agent' method in lib/WWW/RobotRules/AnyDBM_File.pm. It looks
like passing the O_TRUNC flag to the AnyDBM_File constructor did not
result in a clean database for some reason.
> Or is this a problem with Perl's implementation of the AnyDBM_File class? The
> fact that it works under 5.6.0 but fails under 5.6.1 would seem to indicate
> something fundamentally wrong with Perl's attempt to deal with the GNU DBM file
> format, yet the tied variable prints out the correct information, as far as I
> can tell.
>
> Has anyone else seen this problem?
I'm running RedHat 6.0 here and I don't see this problem on either
perl-5.6.0 or 5.6.1. It might be related to what DBM implementation
AnyDBM_File picks up.
I suggest that you do some experiments with AnyDBM_File and O_TRUNC on
your box and tell us what you find out.
If all you want is to use/play with LWP and you don't think you will
write spiders that keep their state in WWW::RobotRules::AnyDBM_File
objects, then you might also simply ignore this problem, type 'make
install' and just move on :-)
Regards,
Gisle