In message <[EMAIL PROTECTED]>, Michael Fowler writes:
>On Tue, Jul 17, 2001 at 06:43:14PM -0400, Jared Chenkin wrote:
>> I'm kinda rusty on my perl..had to work in java for a while =(
>> How do you take a multidimensional hash such as $hash{$key1}{$key2}{$key3} and 
>write it
>> to a database file without too much of a headache?  
>
>    use MLDBM qw(DB_File Storable);
>    use Fcntl qw(O_RDWR O_CREAT);
>
>    tie(%hash, "MLDBM", "file.db", O_RDWR|O_CREAT) || die("tie: $!");
>
>Unfortunately, you have to change how you assign to the hash, from:
>
>    $hash{$key1}{$key2}{$key3} = "foo";
>
>to
>    my $tmp = $hash{$key1};
>    $$tmp{$key2}{$key3} = "foo";
>    $hash{$key1} = $tmp;
>
>Accesses don't need to change, though.
>
>
>Michael
>--
>Administrator                      www.shoebox.net
>Programmer, System Administrator   www.gallanttech.com
>--

Thanks..
This is just funny:

su-2.05# perl dhcpd2.pl
MLDBM error: Please make sure MLDBM/Serializer/Storable.pm is a properly installed 
package.
        Perl says: "Can't locate Storable.pm in @INC (@INC contains: 
/usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503 
/usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/perl5/site_perl/5.005 
.) at /usr/local/lib/perl5/site_perl/5.005/MLDBM/Serializer/Storable.pm line 5.
BEGIN failed--compilation aborted at 
/usr/local/lib/perl5/site_perl/5.005/MLDBM/Serializer/Storable.pm line 5.
" at dhcpd2.pl line 6
tie: No such file or directory at dhcpd2.pl line 6.
su-2.05# find / -name Storable.pm 
/usr/local/lib/perl5/site_perl/5.005/MLDBM/Serializer/Storable.pm

Not sure what to make of it..

Live Large,

Jared Chenkin
<[EMAIL PROTECTED]>
(AIM: DevNull24)
Networked Systems Administrator
Bronx Science Computing


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to