Re: Text to hex

[email protected] ("Mark Wagner")
Newsgroups perl.beginners
Message-ID <[email protected]>
On Fri, May 9, 2008 at 10:02 PM, John W. Krahn <[email protected]> wrote:
> Mark Wagner wrote:
>>
>> Given a string of text, how do I convert it to a string of hexadecimal
>> values?  For example, given the string "Hello", I want the string "48
>> 65 6C 6C 6F".
>
> $ perl -le'my $string = "Hello"; print unpack "H*", $string'
> 48656c6c6f

Thanks.  Is there a good explanation of "unpack" somewhere?

-- 
Mark
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.