Hi Nicholas,
you wrote... (comments in the script removed)
> #!perl
> print input_test('a', 'numeric'), "\n";
> sub input_test {
> my ($input, $test_type, $output) = ($_[0], $_[1], $_[0]);
> if ($test_type eq 'numeric' and not $input =~ m/^\d*$/) {
> $ouptput = 'Non-numeric input';
> } elsif ($test_type eq 'decimal' and not $input =~ m/^(\d|\.)*$/) {
> $ouptput = 'Non-decimal input';
> } else {
> $output = 'Bad &Numbers::input_test() input';
> }
> return $output;
> }
> __END__
Works fine here after correcting the obvious typos: "$ouptput" occurs
twice. How did I find that? By using warnings and "use strict". They
really are your friends!
Cheers,
Paul