Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Pack uneven length hex

by syphilis (Archbishop)
on Nov 23, 2018 at 10:50 UTC ( [id://1226218]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Pack uneven length hex
in thread Pack uneven length hex

I was hoping there's a clever way to work with parameters in pack() itself, which would change it's behavior to pad left side

Not sure that it can be classified as "clever", but if you "scalar reverse()" twice, it seems to produce the correct result (for your given example, at least) :
print scalar reverse unpack "H*", pack("H*", scalar reverse "a12");
Cheers,
Rob

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found