Perl: the Markov chain saw | |
PerlMonks |
Re^3: Persistent data structures -- why so complicated?by Tux (Canon) |
on Mar 12, 2021 at 08:34 UTC ( [id://11129490]=note: print w/replies, xml ) | Need Help?? |
Of course CSV would suffice for the example you gave, but it will be a lot more complicated if you have nested structures. You can combine all the given examples, e.g. use the Database example by using DBD::CSV or next level, tie that CSV database handle with Tie::Hash::DBD and use your hash without changing the rest of your program. One advice: don't underestimate how "simple" CSV is. *do* use a module, like Text::CSV_XS and/or Text::CSV. For the hobbies, you would either require a serialization like Sereal or Storable. If hobbies is the *only* field with multiple values, just drop them at the end of the record, so you can restore them lik
--> use Text::CSV_XS "csv"; Enjoy, Have FUN! H.Merijn
In Section
Seekers of Perl Wisdom
|
|