I've got a package that incorporates validation.
I made it an easy switch, so you can turn it on and off via:
This is done via the following:
Now, thats all working good...
However I need to export a sub, so they don't have to call FieldMap::Method().
Now I understand I have to use the Exporter and populate @EXPORT, but I feel like my import routine is inhibiting this.
Thoughts? Suggestions?
I made it an easy switch, so you can turn it on and off via:
Code:
use FieldMap validate => 1;
This is done via the following:
Code:
my $VALIDATE = 0;
my $VALIDATE_MISSING = 1;
sub import {
my( $pkg, %params ) = @_;
return unless %params;
if ( exists $params{validate} ) {
$VALIDATE = $params{validate};
}
if ( exists $params{validate_missing} ) {
$VALIDATE_MISSING = $params{validate_missing};
}
}
Now, thats all working good...
However I need to export a sub, so they don't have to call FieldMap::Method().
Now I understand I have to use the Exporter and populate @EXPORT, but I feel like my import routine is inhibiting this.
Thoughts? Suggestions?