in reply to validating function input

Correct number of arguments:

sub foo { my $arg_count = 3; if ($arg_count != @_) { die "Incorrect number of arguments to foo"; } #... else do stuff }

Validating the arugment types can vary tremendously depending upon what you want to do. You can read about parameter objects for this type of validation. The code is alpha, but it gives you an idea of how this can be done (it's also probably overkill for your needs). If it's OO code, you can try "Design by Contract", which is implemented in the Class::Contract module.

Cheers,
Ovid

New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)