The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Anansi::Script - Manages how Perl script user input and process output should be handled.

SYNOPSIS

 #!/usr/bin/perl

 use Anansi::Script;

 my $OBJECT = Anansi::Script->new();
 if(defined($OBJECT)) {
     my $channels = $OBJECT->channel();
     if(defined($channels)) {
         my %channelHash = map { $_ => 1 } (@{$channels});
         if(defined($channelHash{MEDIUM})) {
             my $medium = $OBJECT->channel('MEDIUM');
             if('CGI' eq $medium) {
                 $OBJECT->channel('CONTENT', << "HEREDOC"
 <html>
  <body>
   <p>This Perl script was run using the Common Gateway Interface.</p>
  </body>
 </html>
 HEREDOC
                 );
             } elsif('SHELL' eq $medium) {
                 $OBJECT->channel('CONTENT', 'This Perl script was run using the Shell.'."\n");
             }
         }
     }
 }

 1;

DESCRIPTION

Determines the medium used to run the Perl Script and implements the resources to handle the user input and process output. Simplifies the interaction mechanism and enables the Perl Script to be used in different mediums. See Anansi::ComponentManager for inherited methods.

METHODS

addComponent

 # N/A

An overridden inherited method to remove this functionality.

finalise

 $OBJECT::SUPER->finalise(@_);

An overridden virtual method called during object destruction. Not intended to be directly called unless overridden by a descendant.

initialise

 $OBJECT::SUPER->initialise(@_);

An overridden virtual method called during object creation. Not intended to be directly called unless overridden by a descendant.

channelComponent

 my $return = $OBJECT->channelComponent($component, 'some channel');

Attempts to create a new subroutine to enable the direct use of a channel of the currently loaded component and define it as a channel of this module. If a channel with the same name as the component channel already is defined for this module then it silently fails. If a subroutine with the same name as the channel does not exist in this module's namespace then that subroutine name is used otherwise it remains anonymous. Returns 0 (FALSE) on failure and 1 (TRUE) on success.

removeComponent

 # N/A

An overridden inherited method to remove this functionality.

AUTHOR

Kevin Treleaven <kevin AT treleaven DOT net>