print("\n\nEnter a binary number:"); chomp(my $binary=); if ( $binary =~/\D.*/ ) { print("Not a binary number!\n");exit;}