Data::Hive::Store::Param - CGI::param-like store for Data::Hive
version 1.015
This hive store will soon be overhauled.
Basically, it expects to access a hive in an object with CGI's param method, or the numerous other things with that interface.
param
This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years.
Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl.
# use default method name 'param' my $store = Data::Hive::Store::Param->new($obj); # use different method name 'info' my $store = Data::Hive::Store::Param->new($obj, { method => 'info' }); # escape certain characters in keys my $store = Data::Hive::Store::Param->new($obj, { escape => './!' });
Return a new Param store.
Several interesting arguments can be passed in a hashref after the first (mandatory) object argument.
Use a different method name on the object (default is 'param').
This method should have the "usual" behavior for a param method:
calling $obj->param with no arguments returns all param names
$obj->param
calling $obj->param($name) returns the value for that name
$obj->param($name)
calling $obj->param($name, $value) sets the value for the name
$obj->param($name, $value)
The Param store does not check the types of values, but for interoperation with other stores, sticking to simple scalars is a good idea.
This is an object providing the Data::Hive::PathPacker interface. It will convert a string to a path (arrayref) or the reverse. It defaults to a Data::Hive::PathPacker::Strict.
This is a coderef used to check whether a given parameter name exists. It will be called as a method on the Data::Hive::Store::Param object with the path name as its argument.
The default behavior gets a list of all parameters and checks whether the given name appears in it.
This is a coderef used to delete the value for a path from the hive. It will be called as a method on the Data::Hive::Store::Param object with the path name as its argument.
The default behavior is to call the delete method on the object providing the param method.
delete
Hans Dieter Pearcey <hdp@cpan.org>
Ricardo Signes <cpan@semiotic.systems>
This software is copyright (c) 2006 by Hans Dieter Pearcey.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::Hive, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Hive
CPAN shell
perl -MCPAN -e shell install Data::Hive
For more information on module installation, please visit the detailed CPAN module installation guide.