BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:
Having read merlyn's piece on DBM::Deep, it sounded like something that I've wanted for a long time and decided to have a play and wrote the following snippet.
#! perl -slw use strict; use Data::Dumper; use DBM::Deep; unlink './test.dbm'; # my $db = DBM::Deep::new( './test.dbm' ); # gives Can't locate object method "TIEHASH" via # package "./test.dbm" at c:/Perl/site/lib/DBM/Deep.pm line 121 my $db = new DBM::Deep './test.dbm'; $db->{test} = { fred => [ 1 .. 10 ], bill => [ 'a' .. 'z' ] }; print Dumper $db; # The above results in many errors like the following. # Use of uninitialized value in string ne at c:/Perl/site/lib/DBM/Deep +.pm line 704. # Use of uninitialized value in substr at c:/Perl/site/lib/DBM/Deep.pm + line 711. # Use of uninitialized value in substr at c:/Perl/site/lib/DBM/Deep.pm + line 711. # substr outside of string at c:/Perl/site/lib/DBM/Deep.pm line 711. undef $db; $db = new DBM::Deep './test.dbm'; print Dumper $db; # Ditto the above errors.
The first thing I encountered was that the module seems to require the use of indirect object syntax new(), which I tend to use when the constructor takes no arguments, but not when it does.
The second problem was that when I tried to use Data::Dumper to inspect the contents of the hash I created, it causes loads of errors.
Before I send a bug report, am I doing anythng stupid that I haven't spotted? (I tend to be blind to my own errors as some may have noticed:)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBM::Deep problems
by saskaqueer (Friar) on May 20, 2004 at 04:23 UTC | |
by diotalevi (Canon) on May 20, 2004 at 12:04 UTC | |
by BrowserUk (Patriarch) on May 20, 2004 at 04:46 UTC | |
|
Re: DBM::Deep problems
by bmann (Priest) on May 20, 2004 at 04:26 UTC | |
|