Badger::Class::Aliases - class mixin for creating parameter aliases
package My::Module; use Badger::Class base => 'Badger::Base'; use Badger::Class::Aliases user => 'username', pass => 'password'; sub init { my ($self, $config) = @_; $self->init_aliases($config); $self->{ user } = $config->{ user }; $self->{ pass } = $config->{ pass }; return $self; }
This class mixin module allows you to define aliases for configuration parameters.
It is still experimental and subject to change.
This method is mixed into classes that use it. It creates a composite hash of all $ALIASES defined in package variables and updates the $config hash reference, adding entries against the definitive name for any options that are specified using aliases.
$ALIASES
$config
See Badger::Class for further details.
Andy Wardley http://wardley.org/
Copyright (C) 2008 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Badger, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Badger
CPAN shell
perl -MCPAN -e shell install Badger
For more information on module installation, please visit the detailed CPAN module installation guide.