my @tempArr = unpack("B64", $key); my @keyBitsArr = split("", $tempArr[0]); for ($j=0; $j<=$#keyBitsArr; $j++) { $keyBitsArr[$j] += 0; }