in reply to serialise/unserialising data structures
A comment or two: Your code actually only encodes/decodes lists and dictionaries, it will completely ignore single values, eg it wont parse "4:spam" at all. You also have the string/integer parsing code in there twice. You can solve both of these in one go by making the main if (substr(${$dictref},0,1) eq "d") { statement also do strings and integers, and recursing when encountering these inside the dictionary/hash, instead of parsing them on the spot.
Ditto the encoding.
Pretty nifty all the same :)
C.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: serialise/unserialising data structures
by monoxide (Beadle) on May 30, 2005 at 11:30 UTC |