Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2022-06-25 05:25 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (81 votes). Check out past polls.