NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Needs something more generic (Score:2, Insightful)
Maybe to let you do what you want?
# Emulate $Params::Check::STRIP_LEADING_DASHES $Params::Check::NORMALISE_KEY = sub { s/^-// }; # Combine $Params::Check::STRIP_LEADING_DASHES # and to lowercase $Params::Check::NORMALISE_KEY = sub { lc ; s/^-// }; # Example how to add it to the Params::Check source if ( ref $NORMALISE_KEY eq 'CODE' ){ $key = $NORMALISE_KEY->( $key ); } else { croak "$Params::Check::NORMALISE_KEY must be a coderef"; }
You get the idea ...
Clayton
-- tex
Re:Needs something more generic (Score:1)
# Emulate $Params::Check::STRIP_LEADING_DASHES
$Params::Check::NORMALISE_KEY = sub { s/^-// };
# Combine $Params::Check::STRIP_LEADING_DASHES
# and to lowercase
$Params::Check::NORMALISE_KEY = sub { lc ; s/^-// };
# Example of how to add it to the Params::Check source
if ( ref $NORMALISE_KEY eq 'CODE' ){
$key = $NORMALISE_KEY->( $key );
} else {
croak "$Params::Check::NORMALISE_KEY must be a coderef";
}
Clayton
-- tex
Reply to This
Parent
Re:Needs something more generic (Score:1)