BW::Jumptable - Jump table support for BW::*
use BW::Jumptable; my $errstr; my $jumptable = { create => \&create, retrieve => \&retrieve, update => \&update, delete => \&delete } my $jt = BW::Jumptable->new( jumptable => $jumptable ); $jt->jump($q->{action}); error($errstr) if (($errstr = $jt->error));
Creates a new BW::Jumptable object and initializes the jump table. The jumptable property is required. Returns the blessed object handle, or undef if it cannot properly initialize.
Execute a jump. Calls the function referenced in jumptable by the key that matches $action. Returns the value returned by the function, or FAILURE for an error condition. Sets the object error message (see the error() method) for error conditions.
Returns and clears the object error message.
Written by Bill Weinman <http://bw.org/>.
Copyright (c) 1995-2010 The BearHeart Group, LLC
2010-02-02 bw 1.3.1 -- first CPAN version - some cleanup and documenting 2007-07-16 bw -- bugfix - method jump() assumed that the target never returned. 2007-02-22 bw -- initial release.
To install BW::CGI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BW::CGI
CPAN shell
perl -MCPAN -e shell install BW::CGI
For more information on module installation, please visit the detailed CPAN module installation guide.