Sam Vilain > PSA-0.49_01 > PSA::Cache::Entry::PSA

Download:
PSA-0.49_01.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source  

NAME ^

PSA::Cache::Entry::PSA

SYNOPSIS ^

 <?psa my ($psa, @args) = (@_) ?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html 
      PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
       lang="en">
   <head>
     <!-- Insert a one-liner, HTML escaped.  Idea stolen
          from PSP -->
     <title>[+ $variable +]</title>
   </head>
   <body>
     <p>
       <!-- Enclose some arbitary Perl.  Core of ePerl -->
       <?psa print("Ring, ring.");
         print $variable ?>

       <form action="foo.psa">
         <input type="hidden" name="sid" value="[- $sid -]">
         <?psa
            # alternative to the above
            print CGI::escape(qq{<input type="hidden"
                                 name="sid" value="$sid">})
            # call a sub-page, with the given argument
            $psa->include("widget.psa", $user);

            # pages are turned into subs, so return a closure to it.
            # $widget->() will be exactly the same as above
            my $widget = $psa->closure("widget.psa", $user); ?>

            # for example, call a template that takes a
            # widget as a parameter
            $psa->include("pageelement.psa", $widget);

            # access the CGI object
            my $p = $psa->CGI->param("parameter");

            # set a cookie
            $psa->response->set_cookie($cookie);
            ?>

         <!-- Internationalisation -->

         <?psa
           Lexicon->lang = "fr";  # optional, set language
          ?>

         <!-- converted to _("_tag") -->
         [* _tag *]

         <!-- list - call maketext -->
         [* $variable, $foo, $bar *]

         <!-- Lexicon - constant first argument -->
         [* 'Your search matched [quant,_1,document].', $hit_count *]

       </form>
     </p>
   </body>
 </html>

DESCRIPTION ^

A derived class of PSA::Cache::Entry. An object of this type merely runs a different sort of preprocessing when it is compiled.

METHODS ^

preprocess

Force a compilation of the source file, returns true or croaks with compilation error/warning/file not found/etc

run (@args)

Runs the entry, but croaks if not called with the first argument a PSA object.