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

Dean Mah dmah at members.evolt.org
Tue Oct 29 09:39:22 CST 2002

You need to know the format of a dbm dump to know how to unpack it.
What are you using now as the template to unpack?  Are you sure that
is how the binary data is formatted?


On Mon, Oct 28, 2002 at 04:36:27PM -0500, Benjamin C. Varadi wrote:
> 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.
> Anyone?

More information about the thelist mailing list