On 08/03/2012 16:18, sunita.prad...@emc.com wrote:
From: John W. Krahn [mailto:jwkr...@shaw.ca]
> sunita.prad...@emc.com wrote:
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" )'
415A
415B
415C
415D
415E
415F
Thanks John . How can I collect all devices in a array ?
Hi Sunita
If you want the numbers in the range expressed in hex, to put them into
an array you would write
my @devs = map sprintf('%04X', $_), hex( "415A" ) .. hex( "415F" );
HTH,
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/