NAME
Data::Hive::Store::Param - CGI::param-like store for Data::Hive
VERSION
version 1.000
DESCRIPTION
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.
METHODS
new
# 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.
- method
-
Use a different method name on the object (default is 'param').
- escape
-
List of characters to escape (via URI encoding) in keys.
Defaults to the
separator
. - separator
-
String to join path segments together with; defaults to either the first character of the
escape
option (if given) or '.'. - exists
-
Coderef that describes how to see if a given parameter name (
separator
-joined path) exists. The default is to treat the object like a hashref and look inside it. - delete
-
Coderef that describes how to delete a given parameter name. The default is to treat the object like a hashref and call
delete
on it.
BUGS
The interaction between escapes and separators is not very well formalized or tested. If you change things much, you'll probably be frustrated.
Fixes and/or tests would be lovely.
AUTHORS
Hans Dieter Pearcey <hdp@cpan.org>
Ricardo Signes <rjbs@cpan.org>
COPYRIGHT AND LICENSE
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.