Reputation: 1313
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
Upvotes: 2
Views: 909
Reputation: 43168
unpack()
uses $_
by default if you do not provide it with a second parameter; pack()
on the other hand, does not.
Upvotes: 5