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:)


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail

In reply to DBM::Deep problems by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.