Michael Robinton > Apache-EmbeddedPerl-Lite-0.06 > Apache::EmbeddedPerl::Lite

Download:
Apache-EmbeddedPerl-Lite-0.06.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

Apache::EmbeddedPerl::Lite - light weight embedded perl parser

SYNOPSIS ^

  PerlModule Apache::EmbeddedPerl::Lite

  <Files *.ebhtml>
    SetHandler perl-script
    PerlHandler Apache::EmbeddedPerl::Lite
    PerlSetVar ContentType text/html
  </Files>

or

  use Apache::EmbeddedPerl::Lite qw(
        embedded
  };

  $response = embedded($class,$r,$filename,@args)

DESCRIPTION ^

This modules is a light weight perl parser designed to be used in conjunction wit mod_perl and Apache 1 or Apache 2. It may be used as a handler for files containing embedded perl or it may be called as a subroutine to conditionally parse files of your choosing.

Perl code may be embedded in a file parsed by this module as described below. Each section of perl code is collected and eval'd as a subroutine that is passed the two arguments ($classnam,$r) in its input array @_;

Embedded perl should have the following format:

  On a line by itself:

  {optional whitespace}  <!-- {whitespace} perl 

  perl code here

# terminating bracket on a line by itself {optional whitespace} -->

The beginning and terminating brackets may optionally be followed by a white space and comments, which will be ignored.

  i.e.

  <!--  perl
# perl code goes here, it will be executed as a subroutine
#
# anon_sub($classname,$r) {
      my($class,$r) = @_;
      $r->print("Hello World, I am in package $class\n");
# }
  -->

PREREQUISITES ^

        Apache
  or
        Apache2
        Apache2::RequestRec
        Apache2::RequestUtil;
        Apache2::RequestIO;

EXPORT_OK ^

        embedded

AUTHOR ^

Michael Robinton, michael@bizsystems.com

COPYRIGHT ^

Copyright 2013-2014, Michael Robinton & BizSystems This program is free software; you can redistribute it and/or modify it under the same terms of the Apache Software License, a copy of which is included in this distribution.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

syntax highlighting: