Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Re: Text to hex
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 11049 of 11531
Post > Topic >>

Re: Text to hex

by krahnj@[EMAIL PROTECTED] (John W. Krahn) May 10, 2008 at 04:39 AM

Mark Wagner wrote:
> On Fri, May 9, 2008 at 10:02 PM, John W. Krahn <krahnj@[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?

perldoc perlpacktut


John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall
 




 4 Posts in Topic:
Text to hex
carnildo@[EMAIL PROTECTED  2008-05-09 21:14:04 
Re: Text to hex
krahnj@[EMAIL PROTECTED]   2008-05-09 22:02:36 
Re: Text to hex
carnildo@[EMAIL PROTECTED  2008-05-10 00:54:23 
Re: Text to hex
krahnj@[EMAIL PROTECTED]   2008-05-10 04:39:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 19:19:19 CDT 2008.