- or download this
#!/usr/bin/perl -w
use strict;
- or download this
my (@eachnum, $binary, $good, $decimal);
- or download this
print("\n\nEnter a binary number:");
chomp(my $binary=<STDIN>);
if ( $binary =~/\D.*/ ) {
print("Not a binary number!\n");exit;}
- or download this
die "Not a binary number" if $binary =~ /[^01]/
- or download this
convb2d($binary)
- or download this
#!/usr/bin/perl -w
use strict;
...
( "N", pack("B32", substr("0" x 32 . $binary, -32 )));
}