Class::ParmList 1.05
Sponsored Links
Class::ParmList 1.05 Ranking & Summary
File size:
0.016 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
966
Date added:
2007-03-03
Publisher:
Benjamin Franz
Class::ParmList 1.05 description
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 => [qw (-textcolor -border -cellpadding)],
-required => [qw (-bgcolor)],
-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([qw(-name -rank -serial_number)], @_);
#...
}
sub still_another {
my $parms = parse_parms ({
-parms => @_,
-legal => [qw (-textcolor -border -cellpadding)],
-required => [qw (-bgcolor)],
-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.
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 => [qw (-textcolor -border -cellpadding)],
-required => [qw (-bgcolor)],
-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([qw(-name -rank -serial_number)], @_);
#...
}
sub still_another {
my $parms = parse_parms ({
-parms => @_,
-legal => [qw (-textcolor -border -cellpadding)],
-required => [qw (-bgcolor)],
-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.
Class::ParmList 1.05 Screenshot
Class::ParmList 1.05 Keywords
ParmList
ParmList 1.05
Perl module
Named parameter
PARMS
named
QW
error
parameters
processing
Class::ParmList
ClassParmList
Class::ParmList 1.05
Libraries
Programming
Bookmark Class::ParmList 1.05
Class::ParmList 1.05 Copyright
WareSeeker periodically updates pricing and software information of Class::ParmList 1.05 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Class::ParmList 1.05 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Version History
Related Software
Class::InsideOut is a Perl module with a safe, simple inside-out object construction kit. Free Download
Class::XML is a Perl module for simple XML Abstraction. Free Download
fields::aliased is a Perl module that can create aliases for object fields. Free Download
ClearParse is a flexible engine that can be used for any parsing task including interpreting or compiling programming languages. Free Download
Class::Tangram is a Perl module for tangram-friendly classes, DWIM attributes. Free Download
Class::Maker Perl module contains classes, reflection, schema, serialization, attribute- and multiple inheritance. Free Download
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. Free Download
Class::Observable is a Perl module that allows other classes and objects to respond to events in yours. Free Download
Latest Software
Popular Software
Favourite Software