Help for this page

Select Code to Download


  1. or download this
    if ($b=~/^[1-5]\z/) {
       print "\$b has to be a number and is either 1, 2, 3, 4, or 5.\n";
    }
    
  2. or download this
    my $b = "     5    ";
    
  3. or download this
    my $b = "   \t\t  1  \t  ";
    
  4. or download this
    $b =~ s/\s+//g; #additional code
    if ($b=~/^[1-5]\z/) {
       print "\$b has to be a number and is either 1, 2, 3, 4, or 5.\n";
    }