I don't know much about DBM and MLDBM files but I do know a few
methods other methods for persistant data structures.
- Data::Dumper - This module generates a
string representation of your data structure like your one
above which you can write to a text file and restore with
require or eval.
- Storable - This module serializes your data
structure making a binary representation of it and includes
functions for storing and retriving from files. It has the
advantage over Data::Dumper in that its stored structures
use much less disk space.
- XML::Dumper - This module produces a XML
representation of your stucture but since it uses elements
such as <HASH> and <ARRAY> it doesn't make much
sense from a non-perl perspective.
- XML::Simple - This module produces a file like
XML::Dumper but doesn't use perl conventions/identities/names.
You may want to research these a bit more, but any of them
will probably suit most needs with a minimum of hassle.
There are probably more than I can't think of at the moment
as well.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|