in reply to unpack and pack


Here is one way to do it:
$str = join ',', map {sprintf "%02x", $_} unpack 'C*', $value; # And back $str =~ s/,//g; $value = pack "H*", $str;

--
John.

Replies are listed 'Best First'.
Re^2: unpack and pack
by anadem (Scribe) on Apr 28, 2005 at 18:16 UTC
    Ikegami and John -- very many thanks to you both! Alan
Re^2: unpack and pack
by anadem (Scribe) on Apr 28, 2005 at 18:29 UTC
    actually, still many thanks for the attempts, but Ikegami's and John's suggested solutions are giving ASCII versions. That is, instead of giving

    01,02,03,...

    they give

    30,31,30,32,30,33,...