[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] DBM file problems



At 19.44 -0700 2000.04.09, Brian L. Matthews wrote:
>Consider:
>
>#!/usr/bin/perl --
>
>use strict;
>
>use DB_File;
>use Fcntl;
>
>my %dbm;
>
>tie %dbm, 'DB_File', 'illustrations', O_RDWR | O_CREAT, 0644 or
>	die $0, ": can't create new DBM file: $!\n";
>
>$dbm{'abc'} = 0;
>
>my @keys = keys %dbm;
>
>print "number of keys = ", scalar (@keys), "\n";
>print "length of first key = ", length ($keys[0]), "\n";
>__END__
>
>The first time I run this on my G4 running OS 9.0.4 and the last
>released PPC MacPerl, it (correctly) prints the number of keys as 1,
>but prints the length of the first keys as 196611. If I run it again,
>MacPerl crashes with a type 2 error.
>
>While I haven't tried the above on another machine, it's pared down
>from a script that has worked fine on an 840AV and a 6100 for years,
>but won't run on my G4, crashing MacPerl when appending to an element
>of a hash tied to a DB_File file.

Odd.  I have a similar problem, also on Mac OS 9.0.4.  I will have to try
debugging later.  I get:

  number of keys = 1
  length of first key = 65539

Then MacPerl dies after running it another time or two.  I don't know why
the key is reported as being so long.  I have not seen anything like this
before, but cannot attribute it to Mac OS 9.0.4, because I also recently
changed my hard drive, and recall DB_File having certain problems with
certain hard drive formatting things.

-- 
Chris Nandor       |     pudge@pobox.com      |     http://pudge.net/
Andover.Net        | chris.nandor@andover.net | http://slashcode.com/


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org