Interface::Param::Hash - A hash-based implementation of the Interface::Param virtual class methods.
This method implements the Interface::Param virtual method param() by storing your key/value data in memory (with a hash).
package MyObject; use base qw(MyParent Interface::Param::Hash); use warnings; use strict; sub set_defaults { my $self = shift; $self->options( 'sounds' => 0, 'level' => 1, 'volume' => 50 ); } sub print_volume { my $self = shift; print $self->options( 'volume' ); } # create a param method called options sub options { my $self = shift; return $self->param( '__options', @_ ); } 1;
Shaun Guth <l8nite@l8nite.net>
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.
To install Interface::Param, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Interface::Param
CPAN shell
perl -MCPAN -e shell install Interface::Param
For more information on module installation, please visit the detailed CPAN module installation guide.