applications/cpan

perl-Class-ParamParser - Class-ParamParser - Provides complex parameter list parsing

Website: http://www.cpan.org
License: Artistic
Vendor: SME Server, Inc. <http://smeserver.org>
Description:
This Perl 5 object class implements two methods which inherited classes can use
to tidy up parameter lists for their own methods and functions.  The two methods
differ in that one returns a HASH ref containing named parameters and the other
returns an ARRAY ref containing positional parameters.

Both methods can process the same kind of input parameter formats:

=over 4

=item

I<empty list>

=item

value

=item

value1, value2, ...

=item

name1 => value1, name2 => value2, ...

=item

-name1 => value1, -NAME2 => value2, ...

=item

{ -Name1 => value1, NAME2 => value2, ... }

=item

{ name1 => value1, -Name2 => value2, ... }, valueR

=item

{ name1 => value1, -Name2 => value2, ... }, valueR1, valueR2, ...

=back

Those examples included single or multiple positional parameters, single or
multiple named parameters, and a HASH ref containing named parameters (with
optional "remaining" values afterwards).  That list of input variations is not
exhaustive.  Named parameters can either be prefixed with "-" or left natural.

We assume that the parameters are named when either they come as a HASH ref or
the first parameter begins with a "-".  We assume that they are positional if
there is an odd number of them.  Otherwise we are in doubt and rely on an
optional argument to the tidying method that tells us which to guess by default.

We assume that any "value" may be an array ref (aka "multiple" values under the
same name) and hence we don't do anything special with them, passing them as is.
The only exception to this is with "remaining" values; if there is more than one
of them and the first isn't an array ref, then they are all put in an array ref.

If the source and destination are both positional, then they are identical.

Packages

perl-Class-ParamParser-1.0401-2.el4.sme.noarch [18 KiB] Changelog by Shad L. Lords (2007-04-29):
- Clean up spec so package can be built by koji/plague

Listing created by Repoview-0.6.4-1.el5