Re: work with hexadecimal values

2012-03-08 Thread Shawn H Corey
On 12-03-08 03:06 PM, Steve Bertrand wrote: You wanted to find out the numbers between the two. While playing around, I found this: perl -e 'printf "%X\n", $_ for ( 0x415a+1 .. 0x415f-1 ) ...prints: 415B 415C 415D 415E Yes the 0x notation is just another number. You can do anything with it

Re: work with hexadecimal values

2012-03-08 Thread Steve Bertrand
On 2012-03-08 08:24, sunita.prad...@emc.com wrote: Hi 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 ? You wanted to find out the numbers

Re: work with hexadecimal values

2012-03-08 Thread Steve Bertrand
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 ? $ pe

Re: work with hexadecimal values

2012-03-08 Thread Steve Bertrand
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 ? $ pe

Re: work with hexadecimal values

2012-03-08 Thread Rob Dixon
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 a

Re: work with hexadecimal values

2012-03-08 Thread Shawn H Corey
On 12-03-08 11:44 AM, sunita.prad...@emc.com wrote: Sorry , I mean how will I get all those hexadecimal numbers in a array? my @hex = (); for my $nbr ( hex( "415A" ) .. hex( "415F" ) ){ push @hex, sprintf '%04X', $nbr; } You could also use map: my @hex = map { sprintf '%04X', $_ } hex( "4

RE: work with hexadecimal values

2012-03-08 Thread Sunita.Pradhan
Sorry , I mean how will I get all those hexadecimal numbers in a array? -Sunita -Original Message- From: sunita.prad...@emc.com [mailto:sunita.prad...@emc.com] Sent: Thursday, March 08, 2012 9:48 PM To: jwkr...@shaw.ca; beginners@perl.org Subject: RE: work with hexadecimal values

RE: work with hexadecimal values

2012-03-08 Thread Sunita.Pradhan
Thanks John . How can I collect all devices in a array ? -Sunita -Original Message- From: John W. Krahn [mailto:jwkr...@shaw.ca] Sent: Thursday, March 08, 2012 7:11 PM To: Perl Beginners Subject: Re: work with hexadecimal values sunita.prad...@emc.com wrote: > Hi Hello, > I ha

Re: work with hexadecimal values

2012-03-08 Thread John W. Krahn
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" ) .

Re: work with hexadecimal values

2012-03-08 Thread Brian Fraser
On Thu, Mar 8, 2012 at 10:24 AM, wrote: > Hi > > 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 ? > > > Thanks > Sunita > my @numbers = h