in reply to Base10 to Base2.

This avoids assuming the size of an integer.
sub dec_2_bin { my @nib=qw (000 001 010 011 100 101 110 111); map $nib[$_], split( //, sprintf "%lo", $_[0]); };