Firstly, Data::Dumper doesn't give you persistence directly.
It is the storing and retrieval of data serialised by Data::Dumper
that gives you persistence.
How you loop through depends on whether you use coarse or
fine grained persistence.
Coarse grained will retrieve all the data at the start of the progrma and dump it
all at the end. Has the advantage of simplicity, and the data can be manipulated using
normal Perl during the program.
Fine grained will store and retrieve each individual object each time it
is accessed. Advantages are smaller memory footprint for data, and
less likely to lose data if the program crashes. Needs more complicated
mechanism for handling the storage.
Suggested Refernces :
- The Object Oriented Perl book has an excellent tutorial on
persistence, and suggests classes that could abstract the work away into
a class.
- Module DbFramework::Persistent
- Module Tangram
Tangram is fairly heavy duty, and may be overkill, and both assume a
database.
--
Brovnik
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.