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

[MacPerl] DBM file problems



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.

Any ideas?

Thanks,
Brian

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