Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Print hex data in ASCII format as is

by yildiza (Initiate)
on Jun 19, 2012 at 12:22 UTC ( #977054=perlquestion: print w/replies, xml ) Need Help??

yildiza has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I want to read hex data from a binary file and print it on the screen as is. i.e., if data -> ffa3 After printing this on the screen, it should show ffa3 NOT the ASCII equivalents. How can I achieve that using pack or unpack? Thank you.

Replies are listed 'Best First'.
Re: Print hex data in ASCII format as is
by moritz (Cardinal) on Jun 19, 2012 at 12:29 UTC
      Thank you for your answer. It worked. unpack("H*", $data)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://977054]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2022-05-22 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (78 votes). Check out past polls.

    Notices?