[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Storable in ASCII or XML?



On Thu, 21 Sep 2000 13:04:47 -0700, Andrew O. Mellinger wrote:


>>Data::Dumper?

>   I think that is what I'll end up using.

Be extremely careful. I've just tested it on my PC (the power supply on
my Mac blew up today...), and this module does NOT convert arbitrary
bytes into readbale ASCII. Not at all: all data simply pass through,
raw!

	$_ = pack 'C*', 0 .. 255;   # string of all possible bytes
	use Data::Dumper;
	print Dumper $_;


You can use one of those mail/MIME modules to do base64
encoding/decoding. By contrast, UU encoding/decoding is built into Perl.

	$_ = pack 'C*', 0 .. 255;
	$uue = pack 'u*', $_;
	print $uue;

Look ma, Ascii only.

To decode it:

	$raw = unpack 'u*', $uue;

-- 
	Bart.

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org