http://qs1969.pair.com?node_id=1149777


in reply to Re: Storing state of execution
in thread Storing state of execution

I would add that which you want depends a lot on the data you need to store.

If the data is simple and modestly sized, then JSON (or YAML) would probably be best.

If your data includes reference loops or binary data, or if the data structure is large (speed becomes an issue) then Storable would probably be best.

Dumper is more of a middle ground, if you need it to be coder-readable and it is a complex data structure, but you can absolutely trust the source of the data when you read it back. I'd only recommend it as debug output, since reading it back in involves running arbitrary perl code.