| Pangloss documentation | Contained in the Pangloss distribution. |
Pangloss::Terms - a collection of Pangloss terms.
use Pangloss::Terms;
my $terms = new Pangloss::Terms();
try {
my $term = $terms->get( $name );
$terms->add( $term );
$terms->remove( $term );
do { ... } foreach ( $terms->list );
} catch Pangloss::Term::Error with {
my $e = shift;
...
}
This class contains a collection of Pangloss::Term objects. It inherits its interface from Pangloss::Collection.
The collection is keyed on $term->name().
synonym for $obj->keys()
Steve Purkis <spurkis@quiup.com>
Pangloss, Pangloss::Collection, Pangloss::Term, Pangloss::Term::Error
| Pangloss documentation | Contained in the Pangloss distribution. |
package Pangloss::Terms; use strict; use warnings::register; use Error; use Pangloss::Term; use Pangloss::Term::Error; use Pangloss::StoredObject::Error; use base qw( Pangloss::Collection ); our $VERSION = ((require Pangloss::Version), $Pangloss::VERSION)[1]; our $REVISION = (split(/ /, ' $Revision: 1.5 $ '))[2]; sub names { return shift->keys; } sub error_key_nonexistent { my $self = shift; my $name = shift; throw Pangloss::Term::Error(flag => eNonExistent, name => $name); } sub error_key_exists { my $self = shift; my $name = shift; throw Pangloss::Term::Error(flag => eExists, name => $name); } 1; __END__ #------------------------------------------------------------------------------