On 2012-03-08 08:41, John W. Krahn wrote:
sunita.prad...@emc.com wrote:
Hi
Hello,
I have one range of hexadecimal numbers like : 415A till 415F .
I need to find all other numbers between this 2 . Is there any Perl
function which will help to find all numbers or any other way in Perl ?
$ perl -e'printf "%X\n", $_ for hex( "415A" ) .. hex( "415F" )'
I was trying to do it without a function call to hex(). I remember that
Perl understands hex so long as the actual number is prepended with '0x':
perl -e 'printf "%X\n", $_ for ( 0x415a .. 0x415f )'
...as far as using print instead of printf, I didn't do enough testing :)
Here's to learning.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/