Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

In reply to Re: handling Perl Persistent Objects by Brovnik
in thread handling Perl Persistent Objects by rgatliff

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



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-18 14:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found