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

[MacPerl] dbm question (novice level)



Hi,
I'm an academic novice user of MacPerl. I have a text file (4.3 MB)
consisting of many lines containing a word a tab and a number (this
constitutes a word count of an entire year of an Arabic newspaper).  I
wrote a small program to convert this to a hash on disk using dbmopen.  The
program took over 12 hours to run (on a power Mac 6300) and produced a 44.3
MB database file.  Is this normal (both the time and the size of the file)
or did I make some stupid mistake that caused this result?  Here is the
program I ran:

$FName = $ARGV[0];
$FName .= ".db";
dbmopen %H, $FName, 0666;
while (<>) {
chop;
m/\t/;
$name = $`;
$number = $';
$H{$name} = $number;
}
dbmclose %H;

Also, if there is an easy answer to this, could someone explain whether a
database file produced by Macperl is transferrable to UNIX or not?

Thanks,
Dilworth Parkinson
dil@byu.edu