in reply to Re^4: when is "my" not necessary?
in thread when is "my" not necessary?
what is the advantage of using one over the other?
The syntax when dealing with hashes is simpler than when dealing with hash references. When I want to pass them around as arguments though, I tend to use hash references instead. And if you want a hash to be part of a larger data structure, you have no choice but to use references (unless you use a glob, but let's not go there).
what would be the best way to just dump the hashes into a file and load it back up in one swell foop so as to optimize performance? Would the above "Dumper" package be a good choice? And in this case, would I want to use the hash reference form discussed above?
Data::Dumper is good for "seeing" the contents of a data structure for debugging purposes, but for storing and retrieving data, Storable deals better with things like odd characters such as line feeds in the data, though the file it creates is not readable like the output of Data::Dumper. You can also look at things like DBM::Deep (update: or YAML or XML (e.g. XML::Simple) modules).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: when is "my" not necessary?
by demerphq (Chancellor) on Nov 17, 2004 at 21:54 UTC |