Personally I either wouldn't have the test, or else I would make the test be an RE pattern. eg:die "Gotcha!" if validate_integer("not an integer");
sub is_integer { $_[0] =~ /^-?\d+\z/; }
In reply to Re (tilly) 2: An example of programming by contract
by tilly
in thread An example of programming by contract
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |