CGI::Portable::AppStatic

CGI::Portable::AppStatic is a Perl module that allows you to define whole response screens within a config file.
Download

CGI::Portable::AppStatic Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Darren R. Duncan
  • Publisher web site:
  • http://search.cpan.org/~duncand/CGI-Portable-0.51/lib/CGI/Portable/AppMultiScreen.pm

CGI::Portable::AppStatic Tags


CGI::Portable::AppStatic Description

CGI::Portable::AppStatic is a Perl module that allows you to define whole response screens within a config file. CGI::Portable::AppStatic is a Perl module that allows you to define whole response screens within a config file.SYNOPSISSimple program that returns a static HTML page: #!/usr/bin/perl use strict; use warnings; require CGI::Portable; my $globals = CGI::Portable- >new(); my %CONFIG = ( high_http_status_code = > '200 OK', high_http_content_type = > 'text/html', high_page_title = > 'Simple AppStatic Demo', high_page_author = > 'Darren Duncan', high_page_meta = > { keywords = > 'HTTP, HTML, Perl, Static', }, high_page_style_code = > , high_page_body = > __endquote, < h1 >Simple AppStatic Demo< /h1 > < p >This page is a trivial example of what can be done with CGI::Portable when you want your script to always return the same screen. It is more common, however, that your script would contain many screens of which some are dynamic and some are static.< /p > < h2 >Oh, A Table!< /h2 > < table >< tr > < td >Question:< /td >< td >Answer!< /td > < /tr >< tr > < td >Another Question:< /td > < td >This is a really really long answer. It just keeps going on and on and on and on and on and on and on and on and on. However, the short question should stay top aligned with the long answer due to the stylesheet.< /td > < /tr >< /table > __endquote ); $globals- >set_prefs( %CONFIG ); $globals- >call_component( 'CGI::Portable::AppStatic' ); require CGI::Portable::AdapterCGI; my $io = CGI::Portable::AdapterCGI- >new(); $io- >send_user_output( $globals ); 1;Simple program that returns an HTTP redirection header: my %CONFIG = ( high_http_status_code = > '301 Moved', high_http_window_target = > 'nyx_demo_file_window', high_http_redirect_url = > 'http://www.nyxmydomain.net/dir/file.html', );Simple program that returns a bit of binary data: my %CONFIG = ( high_http_status_code = > '200 OK', high_http_content_type = > 'application/xxxencoded', high_http_body = > pack( 'H8', '5065726c' ), high_http_body_is_binary = > 1, );This Perl 5 object class is a simple encapsulated application, or "component", that runs in the CGI::Portable environment. It allows you to define a complete static "program response screen" within the standard "preferences" config file without having to write your own "application" to do it. Or, to be specific, this module allows you to set any CGI::Portable 'Response' properties by providing a like-named "preference" with each new value, rather than having to explicitely call each appropriate accessor method.This module is designed to be easily subclassed by your own application components, so they can do the same things while you only need to program the interesting dynamic functionality. An example scenario has users of your subclassed application using AppStatic methods to apply a common header or footer or stylesheet to every screen. Requirements: · Perl


CGI::Portable::AppStatic Related Software