You can simplify the check on the binary number:
unless( $binary=~/^[01]*$/) die "A binary number contains 1's and 0's! only";^ is the beginning of the string
[01] is a character class matching 0 and 1 only
$is the end of the string
In reply to Re: perl do's and don'ts
by mirod
in thread perl do's and don'ts
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |