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

Re: [MacPerl-AnyPerl] storing a DBM file



At 7.39 -0500 1999.08.03, Adam Price wrote:
>On 8/3/99 at 7:41 AM, pudge@pobox.com (Chris Nandor) wrote:
>
>> At 18.28 -0500 1999.08.02, Adam Price wrote:
>> >    So....how do I save that dbm file?  Why doesn't this work?
>> >
>> >     dbmopen(%saveparsed, 'parsed.nsh', 0666) || die ("Could not open:
>>$!");
>> > %saveparsed =%parsed;
>> >
>> >  dbmclose(%saveparsed) ||die "Couldn't dbmclose: $!"
>> >
>> >  Nor error messages, it just won't hold values which I know are there in
>> >%parsed.
>>
>> Beats me.  What is in %parsed?  Is it a complex data structure containing
>> references (in which case it has already been pointed out that this will
>> fail miserably) or is it a simple hash?

Read this again.


>%parsed has a inventory number in the key, and and 8 fields list in the value.
>The 8 fields are all simple text: title, author, date 1st published and so on.
>Here is a simplified version of what I am shooting for.  It also doesn't "work
>right."
>
>####################CODE#############
>#!perl
>
>@list_1 = qw (pig dog cat horse elephant tapir);
>@list_2 = qw (north east south west up down);
>@list_3 = qw (apple orange papaya goyaba plum);
>
>$parsed{1} =[ @list_1];
>$parsed{2} =[ @list_2 ];
>$parsed{3} =[ @list_3];

These are references: [@foo] is a reference to the contents of the array
@foo.  You Can't Do That in a plain old DBM.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

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