my $binary = sprintf "%b", $inputNumber; my @array = split //, $binary; # if you absolutely want the bits as an array