The concept of "packing" vs. "unpacking" in Perl may seem a bit confusing because we consider clear text "unpacked" and hex "packed". When you think about it, this is ofcourse not really the case as the hex string will always be a hex string but the "clear text" can really be any binary data you can think of.
unpack("H*", "my string"); # = "6d7920737472696e67"
pack("H*", "6d7920737472696e67"); # = "my string"
By the way, don't think for a second that this can be useful for encrypting sensitive data. Hex is almost as easy to read as plaintext once you know the ASCII table.