LoadHtml

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

Generates today's date (default format is "mm/dd/yy" if DBD::Sprite is installed and the "to_char" function from that library is available, otherwise, the format is: scalar(localtime($mtime).

    <!FILEDATE> (or <!FILEDATE:>replace this standalone default text<!/FILEDATE>)

    <!FILEDATE="yyyy-mm-dd"> (or <!FILEDATE="mm/yyyy":>replace this standalone default text<!/FILEDATE>)

Generates the last-modified date/time of the template file (default format is "mm/dd/yy" if DBD::Sprite is installed and the "to_char" function from that library is available, otherwise, the format is: scalar(localtime($mtime).

 V). User-callable Functions (Details):

    &loadhtml($htmlfile, @args)

Main function to read/process a specified template file / url ($htmlfile) and prints out the resulting html page to STDOUT. @args represents a list of values. Each argument value replaces any occurrance of the corresponding parameter number (ie. ":1"...

You can also convert programs that use Template::Toolkit by changing:

    $template_object->process($template_file, $template_hashref);

to:

    &loadhtml($template_file, %{$template_hashref});

    &loadhtml($htmlfile, @args);

is equivalent to:

    print &buildhtml($htmlfile, @args);

    my $html = &buildhtml($htmlfile, @args);

Same as loadhtml, except returns the generated webpage as a string instead of writing it to STDOUT;

    print &dohtml($htmlstring, @args);

    my $html = &dohtml($htmlstring, @args);

Same as buildhtml, except processes a input string instead of a template file or url.

    &AllowEvals(1|0);

Toggles whether or not embedded Perl variables and expressions are performed, namely the <!PERL> and <EVAL> constructs and Perl variables in the format: "<!:$variable>".
Default is 0.

    &set_poc($str);

Sets the string to replace the special "<POCS>" construct. Default is to ignore this tag. If called without a string or an empty string, the string is set to "your website administrator".

    &SetRegices(%optionshash);

Sets special control options. The currently defined options (with their default values) are: -hashes => 0, -CGIScript => 0, -includes => 1, -embeds => 0, -loops => 1, -numbers => 1, -pocs => 0, -perls => 0)

These options allow speeding up processing when turned off (not needed).

    -hashes: Allows the <!HASH> tag sto be processed if on, otherwise ignored.

    -CGIScript: Causes s special hidden form variable called "CGIScript" to be added at
the bottom of the first form with the value set to "$ENV{SCRIPT_NAME}" if on, otherwise not added.

    -includes: Allows the <!INCLUDE> tags to be processed if on, otherwise ignored.

    -embeds: Allows the <!EMBED> tags to be processed if on, otherwise ignored.

    -loops: Allows the <!LOOP> tags to be processed if on, otherwise ignored.

    -numbers: Allows the classic numeric parameter (":1", ":2", etc.) tags to be processed if on, otherwise ignored.

    -pocs: Allows the <!POC> tags to be processed if on, otherwise ignored.

    -perls: Allows the <!PERL> tags to be processed if on, otherwise ignored.

&SetListSeperator($separator_string);

Sets the separator string to be used if an array-reference is passed to a parameter that appears outside of a loop (where a scalar value is expected) Such values are automatically converted to a string of values ala Perl's "join()" function. The defa...

    &SetHtmlHome($htmlhome, $roothtmlhome, $hrefhtmlhome, $hrefcase);

This allows certain embedded links within a document to be "converted" for proper handling. Relative links refer to a different path when the document is loaded via CGI/LoadHTML than then they are loaded directly as urls by a browser, for example, th...

$htmlhome - specifies the URL path to append to relative links in SRC=, HREF=, CL=, HT=, GROUND=, and window.open() arguments.

$roothtmlhome specifies the filesystem path to append to relative file names in <INCLUDE> tags.

$hrefhtmlhome - similar to $htmlhome, but only applies to HREF= links, if it is necessary to redirect them to a different path, ie. a cgi-script for pre-processing. If both $hrefhtmlhome and $htmlhome are specified and non-empty, the former will over...

$hrefcase - used to limit the substitutions of $htmlhome and $hrefhtmlhome to specific links. It can be set to 'l' (Lower-case links only), left undefined for all links, or set to anything else for Upper-case links only. For purposes of case, a "Lowe...

    &loadhtml_package($package_name);

Change the default package LoadHTML uses for embedded Perl variables. Default is main. Best way to set this is to call "loadhtml_package(__PACKAGE__);".
 VI). Minimum System Requirements:

    * 1) Any system supporting Perl and CGI.
    * 2) Perl, v. 5.003 or better.
    * 3) Perl's "LWP" module (not an absolute requirement, but VERY useful) and required prerequesites:  MIME-Base64 (MIME), HTML-Parser (HTML), libnet (Net), MD5, and Data-Dumper (Data).  All of these are available for download from CPAN. 



( run in 1.415 second using v1.01-cache-2.11-cpan-71847e10f99 )