View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Shaun Guth > Interface-Param-0.2 > Interface::Param



Annotate this POD

View/Report Bugs
Module Version: 0.2   Source  


Interface::Param - Virtual class for param() method


This virtual class allows you to specify that your object implements a param() method which allows storing and retrieving data quickly through an interface that is similar to's param() method. It enforces the calling convention of the param() method, but it does not attempt to impose any type of storage system for the key/value pairs.


See Interface::Param::Hash for a useful subclass that implements the virtual methods of this interface.


param ( 'field', key || (list || hash || hashref || arrayref) )

This is the core of the Interface::Param package.


A name to store the data under

'key || (list || hash || hashref || arrayref)'

If no arguments are given, param_get() will be called with no arguments.

If a single scalar argument is passed that isn't a reference, param_get() will be called with the argument and field name sent.

If multiple arguments are given, or a single argument that is a reference, the data will be unwrapped and merged into a hash using conventional means (ie, a hashref will be dereferenced, and a list will be slurped as (key1,value1,...,keyN,valueN); however, array references are treated as a special case. They are mapped with each element being both the key and the value.


param_get ( $field, [@keys] )

If called with no arguments, the typical response is to return a list of all keys. If called with one or more arguments, the values corresponding to those keys are returned.

param_set ( $field, \%data )

Should stores the data received from the input hash. Returns the keys set.

param_del ( $field, [@keys] )

If called with no arguments, delete all data stored for $field. If called with one or more arguments, delete the values stored for those particular keys.


Shaun Guth <>


Copyright (C) 2004 Shaun Guth

This program is free software; you can redistribute it and/or modify it under the same terms as perl itself.

syntax highlighting: