in reply to Using a subroutine as a module

Your module validate.pm *MUST* evaluate to true, ie., by adding 1; at the end of the module, or else it will not be loaded.

Thus your module validate.pm should look like this-
package MyValidate; # use package to declare a module our $val; sub val_time { $val = shift; $val = ($val =~ /^(\d{2}):(\d{2}) (am|pm)$/) ? "$1:$2 $3" : 1; } 1;
Referring to a variable inside a package is not recommended. You could do the following instead -
package MyValidate; # use package to declare a module sub val_time { my $val = shift; $val = ($val =~ /^(\d{2}):(\d{2}) (am|pm)$/) ? "$1:$2 $3" : 1; return $val; # yes this is not necessary but it clarifies my inten +sion } 1;