On 08/03/2012 16:18, [email protected] wrote:
From: John W. Krahn [mailto:[email protected]]
> [email protected] 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: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/