DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Hexadecimal-to-text Converter

07.04.2007
| 13072 views |
  • submit to reddit
        This script converts all 2-digit hexadecimal numbers (without 0x's) in the standard input into text, though there's probably a better way to do this.
#!/usr/bin/perl -wn
use strict;
s/\s//g;
print chr hex $1 while /([[:xdigit:]]{2})/g;
print "\n";