Chest

Chest is a Perl class to store procedures in a hash.
Download

Chest Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Sebastian Knapp
  • Publisher web site:
  • http://search.cpan.org/~sknpp/Chest-0.082/lib/Chest.pm

Chest Tags


Chest Description

Chest is a Perl class to store procedures in a hash. Chest is a Perl class to store procedures in a hash.SYNOPSIS ; use Chest ; my $chest=new Chest ; sub hello { $val={ 'de' => 'hallo', 'en' => 'hello' }->{shift()} ; sub { my $pers=shift; ucfirst($val)." ".$pers } } ; $chest->insert("hello world",&hello("de")) ; print $chest->take("hello world","Welt")This is a simple interface to call subroutines by strings. So it is easy to have longer but readable function calls or totally cryptical ones.USAGEnewA simple Constructor for a hash based object.insert ; $chest->insert("name",sub{my $a=$_;sub{$a}},"name")Important is the second method argument. It's used to be a valid code reference with another code reference as return value. This code ref is then stored under the value from first argument. If an entry exists under this name, this method does nothing. Additional arguments will be used when the second argument is executed.insert_alwaysSame as above but overwrites existing entries.existsCheck if an an entry with a given name exists.takeExecute a stored subroutine with the given arguments. Requirements: · Perl


Chest Related Software