Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Find a hex digit.
- V S Rawat
November 2, 2005, 10:04 am
rate this thread
Re: Find a hex digit.
It converts a _number_ in the range of 10..15 to the corresponding
_character_ in a hexidecimal representation.
By using a "list slice".
I'd prefer for it to function properly over the entire range
of hex values:
$hexdigit = ( '0'..'9', 'a'..'f' )[$digit];
Or just use sprintf().
Tad McClellan SGML consulting
firstname.lastname@example.org Perl programming
Fort Worth, Texas
- » FAQ 4.34 How do I extract selected columns from a string?
- — Previous thread in » PERL Discussions