in reply to Solved : decimal to hex in an array

Don't use similar names for different things. You can confuse them, as you did. The condition should have been
if ($indx % 2 == 0) # ^

Also, the initialization of the array is wrong, it creates just one element. Change it to

my @a = qw(1 10 5 345 2 12);

or

my @a = (1, 10, 5, 345, 2, 12);

or

my @a = split ' ', '1 10 5 345 2 12';
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: decimal to hex in an array
by t-rex (Scribe) on Feb 21, 2017 at 11:00 UTC

    hey, i got my error, it was a silly mistake as u pointed out, the array doesn't come in this form i just tried to simplify things hence I wrote it like this, thanks.