CGI::Path

CGI::Path is a Perl module to aid in traversing one or more paths.
Download

CGI::Path Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Earl J. Cahill
  • Publisher web site:
  • http://search.cpan.org/~earl/CGI-Path-1.12/Path.pm

CGI::Path Tags


CGI::Path Description

CGI::Path is a Perl module to aid in traversing one or more paths. CGI::Path is a Perl module to aid in traversing one or more paths.SYNOPSISCGI::Path allows for easy navigation through a set of steps, a path. It uses a session extensively (managed by default via Apache::Session) to hopefully simplify path based cgis.A PATHA path is a package, like CGI::Path::Skel. The path needs to be @ISA CGI::Path. The package can contain the step methods as described below. You can also make a directory for the path, like CGI/Path/Skel, where the direectory will contain a package for each step. This could be done from your $ENV{PERL5LIB}.path_hashThe path_hash is what helps generate the path_array, which is just an array of steps. It is a hash to allow for easy overrides, since it is sort of hard to override just the third element of an array through a simple new.The path_hash needs a key named 'initial_step', and then steps that point down the line, like so path_hash => { initial_step => 'page_one', page_one => 'page_two', page_two => 'page_three', },since page_three doesn't point anywhere, the path_array ends. You can just override $self->path_hash, and have it return a hash ref as above.path_arrayThe path_array is formed from path_hash. It is an array ref of the steps in the path.my_modulemy_module by default is something like CGI::Path::Skel. You can override $self->my_module and have it return a scalar containing your my_module. Module overrides are done based on my_module.my_contentmy_module by default is something like path/skel. It defaults to a variant of my_module. You can override $self->my_content and have it return a scalar your my_content. html content gets printed based on my_content.include_pathinclude_path is a method that returns the include_path to look through for files. I suggest returning an array ref, even if it only contains one element.navigate$self->navigate walks through a path of steps, where each step corresponds to a .htm content file and a .val validation hash.A step corresponds to a .htm content file. The .htm and .val need to share the base same name.$self->{this_step} is hash ref containing the following previous_step => the last step this_step => the current step validate_ref => the validation ref for the current stepGenerally, navigate generates the form (see below), and for each step does the following -- Get the validate ref (val_ref) for the given page -- Comparing the val_ref to the form see if info exists for the step -- Validate according to the val_ref -- If validation fails, or if info doesn't exist, process the page and stopMore specifically, the following methods can be called for a step, in the given order.step details/possible uses --------------------------------------------- ${step}_hook_pre initializations, must return 1 or step gets skipped info_exists checks to see if you have info for this step ${step}_info_complete can be used to make sure you have all the info you need validate contains the following ${step}_pre_validate stuff to check before validate proper validate_proper runs the .val file validation ${step}_post_validate stuff to run after validate proper ${step}_hash_fill return a hash ref of things to add to $self->fill fill is a hash ref of what fills the forms ${step}_hash_form perhaps set stuff for $self->{my_form} my_form is a hash ref that gets passed to the process method ${step}_hash_errors set errors ${step}_step do actual stuff for the step ${step}_hook_post last chance Requirements: · Perl


CGI::Path Related Software