in reply to print hash into scalar
You could use Storable as a mechanism for serialising your hash into a scalar. I would recommend this approach as it's quite space-efficient. Much more so than, for example, Data::Dumper with $Data::Dumper::Indent = 0.
On the other hand, if Storable is space-efficient, it is because the data structure is written in a binary format. That means that you can't easily inspect the values during a debugging run, whereas you could with Data::Dumper.
Finally, Data::Dumper is dangerous for serialisation, because you recover it with an eval, which gives the bad guys a chance to Nasty Things™ to your system.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: print hash into scalar
by rob_au (Abbot) on Dec 23, 2002 at 08:39 UTC |