Class::ParmListClass::ParmList is a Perl module with methods for processing named parameter lists. | |
Download |
Class::ParmList Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Benjamin Franz
- Publisher web site:
- http://www.nihongo.org/snowhare/utilities/ftpweblog/
Class::ParmList Tags
Class::ParmList Description
Class::ParmList is a Perl module with methods for processing named parameter lists. Class::ParmList is a Perl module with methods for processing named parameter lists.SYNOPSIS use Class::ParmList qw(simple_parms parse_parms); $thingy->some_method({ -bgcolor => '#ff0000', -textcolor => '#000000' }); sub some_method { my ($self) = shift; my ($parm_ref) = @_; my $parms = Class::ParmList->new ({ -parms => $parm_ref, -legal => , -required => , -defaults => { -bgcolor => "#ffffff", -textcolor => "#000000" } }); if (not defined $parms) { my $error_message = Class::ParmList->error; die ($error_message); } # Stuff... } sub another_method { my $self = shift; my ($name,$rank,$serial_number) = simple_parms(, @_); #... } sub still_another { my $parms = parse_parms ({ -parms => @_, -legal => , -required => , -defaults => { -bgcolor => "#ffffff", -textcolor => "#000000" } }); if (not defined $parms) { my $error_message = Class::ParmList->error; die ($error_message); } # ... }This is a simple package for validating calling parameters to a subroutine or method. It allows you to use "named parameters" while providing checking for number and naming of parameters for verifying inputs are as expected and meet any minimum requirements. It also allows the setting of default values for the named parameters if omitted. Requirements: · Perl
Class::ParmList Related Software