Re: A neat trick to serialize arrays and hashes
From: Ben Morrow (usenet_at_morrow.me.uk)
Date: 06/18/04
- Next message: Tassilo v. Parseval: "Re: A neat trick to serialize arrays and hashes"
- Previous message: Matt Garrish: "Re: Problem with DOS paths in perl - cmd.exe vs. command.exe"
- In reply to: J. Romano: "A neat trick to serialize arrays and hashes"
- Next in thread: Tassilo v. Parseval: "Re: A neat trick to serialize arrays and hashes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 18 Jun 2004 04:35:55 +0000 (UTC)
Quoth jl_post@hotmail.com (J. Romano):
> 3. This technique only handles simple arrays and hashes.
> In other words, multi-dimensional arrays and hashes,
> lists of lists, an references are not handled
> correctly. If you really want to serialize a
> complex structure such as one of these, I recommend
> using another approach, like taking advantage of
> the Data::Dumper module. You CAN however, create
> an array of these serialized arrays, and serialize
> that array!
...however, you can't then unserialize it, as the references have been
stringified and can't be converted back to refs. Yet another reason the
use Storable, which does this right...
Ben
--
perl -e'print map {/.(.)/s} sort unpack "a2"x26, pack "N"x13,
qw/1632265075 1651865445 1685354798 1696626283 1752131169 1769237618
1801808488 1830841936 1886550130 1914728293 1936225377 1969451372
2047502190/' # ben@morrow.me.uk
- Next message: Tassilo v. Parseval: "Re: A neat trick to serialize arrays and hashes"
- Previous message: Matt Garrish: "Re: Problem with DOS paths in perl - cmd.exe vs. command.exe"
- In reply to: J. Romano: "A neat trick to serialize arrays and hashes"
- Next in thread: Tassilo v. Parseval: "Re: A neat trick to serialize arrays and hashes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|