Shaun Guth > Interface-Param-0.2 > Interface::Param::Hash

Download:
Interface-Param-0.2.tar.bz2

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.2   Source  

NAME ^

Interface::Param::Hash - A hash-based implementation of the Interface::Param virtual class methods.

DESCRIPTION ^

This method implements the Interface::Param virtual method param() by storing your key/value data in memory (with a hash).

SYNOPSIS ^

 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;

METHODS ^

See "METHODS" in Interface::Param

AUTHOR ^

Shaun Guth <l8nite@l8nite.net>

LICENSE ^

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: