[thelist] can someone explain perl's pack/unpack to me?

Benjamin C. Varadi bvaradi at nlcnet.org
Tue Oct 29 00:20:01 CST 2002

okay, so i'm a perl idiot, and was content to stay that way, but i'm hosting
this guy's site & trying to help him w/ a frustrating situation.

he has two copies of a Berkeley db dump.  one is entirely in hex pairs, ie,
every other line reads:
5345524700000007626c6f675f69640000000132000000057469746c65000... (this is
extremely long)

and the other is in ascii, with "nonprintable" characters in escaped hex
pairs, ie every other line reads:
SERG\00\00\00\07blog_id\00\00\00\012\00\00\00\05title\00\00\0... (also
extremely long)

I need to turn one of these into pure ASCII w/ invisible characters either
stripped out or escaped HTML, so i can then further format it into a human
readable, moveabletype input file.

I know that I need to use unpack, but my efforts have left me with a results
file that seems to be just a few numbers repeated again & again.


Please don't recommend alternate suggestions found anywhere in the MT
documentation/support forum.  I've already tried 'em all.



More information about the thelist mailing list