Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: String to Byte array

by BrowserUk (Pope)
on Sep 19, 2013 at 20:50 UTC ( #1054910=note: print w/ replies, xml ) Need Help??


in reply to Re: String to Byte array
in thread String to Byte array

What the OP probably needs, rather than an array of integers, is a binary string of unsigned chars derived from the hex string input.

That is done using pack, not unpack:

print pack 'H*', "A21B12C212AD12FF";; ←↕┬↕↕

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re^2: String to Byte array
Download Code
Re^3: String to Byte array
by kpaxian25 (Novice) on Sep 20, 2013 at 21:11 UTC
    Thanks that helped me to get the same output as C# code. Perl Rules :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1054910]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2015-07-02 01:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (25 votes), past polls