[Pdx-pm] Instance hash ( keyed array )

Kris Bosland krisb at ring.org
Tue Oct 17 13:49:41 PDT 2006


	Any reason not to use an SQL database?  You may get better
performance.  SQLite is quite lightweight and easy.

-Kris

On Tue, 17 Oct 2006, Roderick A. Anderson wrote:

> I'm working on a module [0] that needs to do something I have not seen
> in any other module or documentation.  It may be my ignorance that is
> making this complicated.
>
> I need to build a, sometimes, quite large hash table ( 40,000 - 470,000
> records ) one record at a time.  The method will return the key it is
> used to the caller so it can be used to key the rest of the data not
> passed in to the method.
>
> Here is the sub.
>
> sub add_addr {
>
>      my $self = shift;
>      my @stuff = @_;
>
>      my $recid = $self->inc_recid();
>      my $addr = join( $FldDelim, $recid, @stuff );
>      $addr .= $RcdDelim;
>
>      $self->{addr_data}->{$recid} = $addr;
>
>      return $recid;
> }
>
> Is there a better way to do this?
>
> [0] actually re-working a script into a module.
>
>
> Thanks for any insights or ideas,
> Rod
> --
> _______________________________________________
> Pdx-pm-list mailing list
> Pdx-pm-list at pm.org
> http://mail.pm.org/mailman/listinfo/pdx-pm-list
>
>
> !DSPAM:45353b56259991061372519!
>
>



More information about the Pdx-pm-list mailing list