Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Use a Serialized Hash... When It Might Not Exist?

by afoken (Chancellor)
on Nov 12, 2022 at 20:50 UTC ( [id://11148161]=note: print w/replies, xml ) Need Help??


in reply to Use a Serialized Hash... When It Might Not Exist?

A very minor issue with Storable is that it depends on at least the perl version, maybe also on compile-time settings. This may cause trouble when you update perl.

Other serialization formats do not have that specific problem.

Using JSON would make your serialized hash human readable (at least when adding some whitespace).

YAML and Data::Dumper output may contain executable code, reading them back may cause security problems.

Sereal promises to be fast and compact, but it is a binary format like Storable.

XML is bloat, can't store 0x00, *and* has security issues (Billion laughs attack).


If your hash is as simple as shown (no references, just a key-value-store), also consider SQLite with a simple two-column table. (See DBI and DBD::SQLite). As a minor and probably welcome side-effect, the database file will automatically be created at first use.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-03-29 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found