Can someone explains me why this is not working as I expect it?
zen:~ emx$ echo ABC | perl -nle "print unpack 'H*'"
414243
zen:~ emx$ echo 414243 | perl -nle "print pack 'H*'"
zen:~ emx$
Somehow I was expecting the second command to print ABC
unpack()
uses $_
by default if you do not provide it with a second parameter; pack()
on the other hand, does not .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.