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

Re: [MacPerl] Speed question



Giorgio Valoti wrote:

> Ken Williams wrote:
>
> > aml@world.std.com (Andrew M. Langmead) wrote:
> > >You might be better of grabbing on key at a time by using the iterator
> > >built into the scalar context version of keys().
> > >
> > >while(defined(my $key = keys %database) ) {
> > >  print DUMP "$key\n". ("=" x (length($key)+1))."\n";
> > >  print DUMP "$database{$key}\n\n";
> > >}
> >
> > I think you really mean:
> >
> >     while (my ($key) = each %database) {
> >
> > (Yes, the boolean case-checking is correct.  Try it with the hash
> > %hash = (0,1,2,3,4,5);)
> >
> > In a scalar context, the keys() function returns the *number* of keys in
> > the hash.
>
> Ken,
>
> I get the same results... :-(
>

OK that's me again... It seems that I have solved the problem; you have
to a
cache value, something like:

 $DB_HASH -> {'cachesize'} = 10000000;
    tie %h, "DB_File", "filename", O_RDWR|O_CREAT, 0640, $DB_HASH
        or die "Cannot open file 'filename': $!\n";

Only one more question: in which value the cache size is expressed?
thanks to all again!

--
Giorgio Valoti

MagneticMedia Network

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