in reply to Your named arguments
use Params::Validate qw(validate); sub convert { my %args = validate(@_, { from => 1, to => 1, thing => 1}); # ... }
Constructing a more interesting example would require knowing what kind of data should be in the parameters. Params::Validate has some decent built-in type-checks and makes rolling your own easy.
-sam
|
---|