James Tillman > Devel-ModInfo-0.05 > Devel::ModInfo::ParamHashRef

Download:
Devel-ModInfo-0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.2   Source  

Devel::ModInfo::ParamHashRef ^

Devel::ModInfo::ParamHashRef - Defines a hash reference of parameters expected by a function, method, or constructor

SYNOPSIS ^

Not meant to be used outside the ModInfo system.

DESCRIPTION ^

Devel::ModInfo::ParamHashRef defines a hash reference which contains a collection of key/value pairs that should be passed into a method, function, or constructor. The key/value pairs are defined by instances of the Devel::ModInfo::ParamHash::Key class.

The ParamHashRef describes a common Perl construct in which a Perl hash reference is used to provide parameters to a function. It often looks like the following:

sub mysub { my ($self, $params) = @_; unlink($params->{file_name}); #Do other stuff }

The hash reference named $params will have all the key/value pairs passed into the function. This method emulates what is called "named parameters" in some other languages. In these constructs, the order of the parameters does not matter, as the name of each parameter, rather than its position, determines how the value is applied.

AUTHOR ^

jtillman@bigfoot.com

tcushard@bigfoot.com

SEE ALSO ^

Devel::ModInfo::Tutorial

Devel::ModInfo::ParamHash::Key

perl(1)

syntax highlighting: