Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Storing and retrieving a hash of objects

by Frnak (Initiate)
on Sep 03, 2013 at 12:41 UTC ( #1052099=note: print w/replies, xml ) Need Help??


in reply to Re: Storing and retrieving a hash of objects
in thread Storing and retrieving a hash of objects

Hi Rodion,
thanks for your fast answer and sorry for my late reply,
had no internet access the last few days.
So as I understand this de/serialization fails as
Storable does not know how to do it for a
Set::IntervalTree object.
This means that I either find a way to let Storable
know how to do it or choose an other object type to store.
I tried to figure out how to do some Storable wizardry
but I guess it's over the top for my problem.
If anyone has the will to give me a hint on how one
could do this I'm very willing to try, but I guess it
would take some time which may be better spent otherwise.

For the moment I'll try to use an alternative object to store my coordinates. Thanks again for your help!
  • Comment on Re^2: Storing and retrieving a hash of objects

Replies are listed 'Best First'.
Re^3: Storing and retrieving a hash of objects
by rodion (Chaplain) on Sep 03, 2013 at 20:56 UTC
    It would take a little work to put together serialization routines for Set::IntervalTree and Storable to play smoothly together. That may be worth it if you're going to make heavy use of this, but a quick workaround is to write specialized serialization and de-serializetion routines good enough for your own code and use those convert from a hash of objects to a hash of strings and back. Then you can use Storable on the hash of strings. It sounds like you're thinking along these lines already.

    One advantage of this approach is that if you decide to do the more general job, you've got some prototyping already under your belt.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1052099]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2021-10-28 06:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (95 votes). Check out past polls.

    Notices?