Re: Array elements in Hash

2012-10-05 Thread jet speed
is help. >>> >>> @match = ("6c7b00", "6d7b00", "6d9d8f", "6c6863", "6e6632"); >>> >>> >>> %abc = ('6c' =>'device1', '6d'=> 'device5', '6e'=> &#x

Re: Array elements in Hash

2012-10-05 Thread Shekar
Shekar wrote: > >> Would this help. >> >> @match = ("6c7b00", "6d7b00", "6d9d8f", "6c6863", "6e6632"); >> >> >> %abc = ('6c' =>'device1', '6d'=> 'device5', '6

Re: Array elements in Hash

2012-10-05 Thread jet speed
@match = ("6c7b00", "6d7b00", "6d9d8f", "6c6863", "6e6632"); > > > %abc = ('6c' =>'device1', '6d'=> 'device5', '6e'=> 'device3', > '6g'=>'device9'); > > f

Re: Array elements in Hash

2012-10-04 Thread Shekar
7;); foreach my $element(@match) { print $element."=>".$abc{substr($element, 0, 2)}."\n"; } -- Shekar On Thu, Oct 4, 2012 at 10:14 PM, Lawrence Statton wrote: > On 10/04/2012 11:26 AM, jet speed wrote: > >> Hi All, >> >> >> I a

Re: Array elements in Hash

2012-10-04 Thread Lawrence Statton
On 10/04/2012 11:26 AM, jet speed wrote: Hi All, I am trying to find the array elements in hash, if it matches then print the hash value. Please help me to achieve this. Note: array elements matches the first 2 characters of the hash keys. @match = ("6c7b00", "6d7b00"

Re: Array elements in Hash

2012-10-04 Thread David Precious
On Thu, 4 Oct 2012 17:26:23 +0100 jet speed wrote: > I am trying to find the array elements in hash, if it matches then > print the hash value. Please help me to achieve this. > > Note: array elements matches the first 2 characters of the hash keys. > > > @match = ("

Array elements in Hash

2012-10-04 Thread jet speed
Hi All, I am trying to find the array elements in hash, if it matches then print the hash value. Please help me to achieve this. Note: array elements matches the first 2 characters of the hash keys. @match = ("6c7b00", "6d7b00", "6d9d8f", "6c6863", &