Refactoring your refactoring just a tad…
# Get the input... print "\nEnter the power (a positive integer from 1 through 9): "; chomp(my $power = (<STDIN>)); # Quietly end if there's no input... $power =~ m/\S/ or exit 1; # Validate the input... $power =~ m/^[1-9]$/ or die "$power is not a positive integer from 1 through 9\n";
In reply to Re^2: Algebraic Expansion of Binomials Using a Recursive Subroutine
by Jim
in thread Algebraic Expansion of Binomials Using a Recursive Subroutine
by lilgreen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |