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?? |
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". ;-)
In Section
Seekers of Perl Wisdom
|
|