Stringifying data without newlines.

S

Stuart Moore

I'm looking at ways to stringify large, simple data structures (i.e. non
self-referential multi-dimensional data structures). They're to be passed
over a socket to another perl process in the same machine - currently I
use a newline as a "message terminator", I can change this if necessary
but would perfer not to.

Data::Dumper works with Indent 0 and Useqq 1 (and if the data contains no
newlines I don't need Useqq 1) but it's still a little on the slow side, I
was wondering whether any of the other modules (FreezeThaw, Storable etc)
are also guaranteed not to contain newline characters in their stored
version; neither documentation says anything on this matter.

Any suggestions?

Stuart Moore
 
B

Bart Lateur

Stuart said:
I
was wondering whether any of the other modules (FreezeThaw, Storable etc)
are also guaranteed not to contain newline characters in their stored
version

As these produce a binary dump of the data, I would definitely think
not.

You could postprocess with base64 encoding..?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top