in reply to Re: Get Element inArray
in thread Get Element inArray

gopalr said my $res=@arr[-2]

I think you mean my $res=$arr[-2];
If you have warnings turned on (which we all should!) it doesn't like the @arr[-2] method. When referring to a scalar element of an array you should specify that it is scalar with $

-Kevin
my $a='62696c6c77667269656e6440676d61696c2e636f6d'; while ($a=~m/(^.{2})/s) {print unpack('A',pack('H*',"$1"));$a=~s/^.{2}//s;}