It basically uses pack putting high nybble first, then unpack putting high nybble last to do the trick.
Note that it works only for HEX dumps, i.e. couples of octets in 0-9a-fA-F, so its usefulness is quite limited...
my $start = "214365"; my $final = unpack "h*", pack "H*", $start;
In reply to Swapping odd-even characters of BCD hex data by polettix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |