Just another Perl shrine | |
PerlMonks |
Re: Persistent data structures -- why so complicated?by Discipulus (Canon) |
on Mar 11, 2021 at 18:13 UTC ( [id://11129466]=note: print w/replies, xml ) | Need Help?? |
Hello davebaker, probably I missed the point but if you are programming in perl I do not see the complexity using Storable. Anyway first of all take a look to a recent thread: Banal Configuration Languages That said you can have a lot of options beside Storable. The basic Data::Dumper dumps structures that can be eval -ed to have the datastructure back. If you like more human readable solutions there is YAML or the very common outside perl world JSON I used something like perl -MYAML -MStorable -e "print Dump @{retrieve ($ARGV[0])};" and perl -e "use YAML (LoadFile); use Storable qw(nstore); @ar = LoadFile($ARGV[0]); nstore(\@ar, $ARGV[1])" to translate YAML and Storable formats. A plethora of Config::* modules are also available. You can have comma separated data, in external files but also after the __DATA__ token.. So.. many many options for every taste. HTH
L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|