Embperl(3pm)
π Embperl(3pm) π
okay bestie, welcome to Embperl(3pm) from the User Contributed Perl Documentation. this page is giving βbuild dynamic websites with Perlβ and honestly? iconic. π«Άβ¨
β¨ NAME β¨
Embperl- Building dynamic Websites with Perl π
π SYNOPSIS π
For a list of available Embperl documentation, bestie, please view Embperl::TOC with perldoc(1) or man(1). If Embperl is not yet installed, have a look at perldoc TOC.pod in the distribution archive. no cap, thatβs the whole synopsis. π
πΈ DESCRIPTION πΈ
Embperl is a framework for building websites with Perl. fr fr.
For the beginner itβs any easy to setup and use way of embedding Perl code in HTML pages. literally the group-chat beginner arc.
It delivers several features that ease the task of creating a websites, including dynamic tables, formfield-processing, escaping/unescaping, session handling, caching and more. obsessed.
If your demands grows it gives you the power to make your Web site object-oriented and build it out of small reusable components. If you don't like the idea of mixing up all your layout and code Embperl supports separating it in different objects (e.g. createing an MVC application). Of course Embperl doesn't ties you to HTML, it allows components to be from different source formats (e.g. HTML, WML, XML, POD, ...) and if necessary transforms it (for example via XSLT) to other output formats. This is achieved by diving the output generation in small steps, where each is processed by a plugable provider.
Advanced user can create their own syntax definitions (for example tag libraries) and extent Embperl by writing their own providers and much more. periodt.
β οΈ IMPORTANT: This document describes the syntax and several features of Embperl. Please read alsoperldoc Config.pod, which describes how to configure Embperl and how to access the different Embperl objects and their data. Also take a look atperldoc Embperl::Objectto learn how to use Embperl page as objects. π«Ά
Additionally there are a few introductions documents should consider to read: Intro.pod, IntroEmbperl2.pod and IntroEmbperlObject.pod. iykyk π
π SYNTAX π
Embperl understands two categories of commands. The first one are special Embperl commands, and the second category consists of some HTML tags which can trigger special processing. Embperl commands can span multiple lines and need not start or end at a line boundary. lowkey flexible.
Before the special Embperl commands are processed, and for the VALUE attribute of the INPUT tag (see below), all HTML tags are removed and special HTML characters are translated to their ASCII values (e.g., < is translated to <). You can avoid this behavior by preceding the special character or HTML tag with a backslash. This is done in case your favorite (WYSIWYG) HTML editor inserts tags like line breaks or formatting into your Embperl commands where you don't want them. bestie, itβs for your own good.
All Embperl commands start with a [ and end with a ]. To get a real [ you must enter [[. β¨
Embperl does not use SGML comments (i.e., <! ... !> or similar things) because some HTML editors can't create them, or it's much more complicated. Since every HTML editor takes (or should take) [ and ] as normal text, there should be no problem. slay.
β¨ [+ Perl code +] β¨
Replace the command with the result you get from evaluating the Perl code. The Perl code can be anything which can be used as an argument to a Perl eval statement. (See (Safe-)Namespaces and opcode restrictions below for restrictions.) Examples:
[+ $a +] Replaces the [+ $a +] with the content of
the variable $a
[+ $a+1 +] (Any expression can be used)
[+ $x[$i] +] (Arrays, hashes, and more complex
expressions work)
NOTE: Whitespace is ignored. The output will be automatically HTML-escaped (e.g.,<is translated to<) depending on the value of the variables$escmode. You do not have to worry about it. π
π [- Perl code -] π
Executes the Perl code, but deletes the whole command from the HTML output. not me disappearing from the output, literally.
Examples:
[- $a=1 -] Set the variable $a to one.
No output will be generated.
[- use SomeModule ; -] You can use other modules. NOTE the semicolon!
[- $i=0; while ($i<5) {$i++} -] Even more complex
statements or multiple
statements are possible.
NOTE: Statements likeif,while,for, etc., must be contained in a single Embperl command. You cannot have theifin one command block and the terminating}orelsein another.
NOTE: To define subroutines, use[! Perl Code !](see below) instead of[- ... -]to avoid recompilation of the subroutine on every request.
π¦ [! Perl Code !] π¦
Same as [- Perl Code -] with the exception that the code is only executed at the first request. This could be used to define subroutines, or do one-time initialization. one-time main character energy.
β [* Perl code *] β
(only version 1.2b2 or higher) EXPERIMENTAL!
This is similar to [- Perl Code -]. The main difference is, while [- Perl Code -] always has its own scope, all [* Perl code *] blocks runs in the same scope. This allows you to define "local" variables with a scope of the whole page. Normally, you don't need to use local, because Embperl takes care of separate namespaces of different documents and cleanup after the request is finished, but in special cases it's necessary. For example, if you want to recursively call an Embperl document via Execute.
There is a second reason to use the [* Perl code *] instead of the [- Perl Code -]. If you like to use perl's control structures. Perl's if, while, for etc. can not span multiple [- Perl Code -] blocks, but it can span multiple [* Perl Code *].
Example:
[* foreach $i (1..10) { *]
[- $a = $i + 5 -]
loop count + 5 = [+ $a +] <br>
[* } *]
The following won't work:
[- foreach $i (1..10) { -]
some text here <br>
[- } -]
The same can be done with Embperl meta commands (see below)
[$ foreach $i (1..10) $]
[- $a = $i + 5 -]
loop count + 5 = [+ $a +] <br>
[$ endforeach $]
NOTE 1:[* ... *]blocks _must_ always end with a;,{or}
NOTE 2:[* ... *]cannot apear inside a html tag that is interpreted by Embperl (unless you disable the interpretation of such tags liketable,inputetc.)
NOTE 3: There are still benefits of using [- ... -] and metacommands:
- much better debugging in the log file.
- no restriction on where they can be used. You can use them anywhere; even inside html tags that are interpreted by Embperl.
π [# Some Text #] (Comments) π
(only version 1.2b2 or higher)
This is a comment block. Everything between the [# and the #] will be removed from the output. bye bye π
NOTE 1: The [* ... *] blocks are interpreted before the comment block, so they are executed also inside a comment.
NOTE 2: Everything (except[* ... *]) is really removed from the source, so you can also use the[# ... #]block to take a part out of your document.
π [= =] (Internationalisation) π
Defines a string which should be translated into a local language. See Internationalisation (I18N) for details. π
π [$ Cmd Arg $] (Meta-Commands) π
Execute an Embperl metacommand. Cmd can be one of the following. (Arg varies depending on <Cmd>).
π if, elsif, else, endif
Everything following the if metacommand until the else, elsif, or endif is only output if the Perl expression given in Arg is true. else and elsif work similarly.
Example:
[$ if $ENV{REQUEST_METHOD} eq 'GET' $]
Method was GET<BR>
[$ else $]
Method other than GET used<BR>
[$ endif $]
This will send one of the two sentences to the client, depending on the request method used to retrieve the document.
πΈ while, endwhile
Executes a loop until the Arg given to while is false.
Example: (see eg/x/loop.htm)
[- $i = 0; @k = keys %ENV -]
[$ while ($i < $#k) $]
[+ $k[$i] +] = [+ $ENV{$k[$i]} +]<BR>
[- $i++ -]
[$ endwhile $]
This will send a list of all environment variables to the client.
π do, until
Executes a loop until the Arg given to until is true.
Example:
[- $i = 0 -]
[$ do $]
[+ $i++ +] <BR>
[$ until $i > 10 $]
π¦ foreach, endforeach
Executes a loop for each element of the second Arg, setting the first Arg accordingly.
Example:
[- @arr = (1, 3, 5) -]
[$ foreach $v (@arr) $]
[+ $v +] <BR>
[$ endforeach $]
β next
Inside of looks same as Perl next statement. You could also use the following syntax, which allows you to add an additional condition (or any other Perl code):
[* next if ($foo) *]
π₯ last
Inside of looks same as Perl last statement. You could also use the following syntax, which allows you to add an additional condition (or any other Perl code):
[* last if ($foo) *]
π« redo
Inside of looks same as Perl redo statement. You could also use the following syntax, which allows you to add an additional condition (or any other Perl code):
[* redo if ($foo) *]
π» hidden
Arg consists of zero, one or two names of hashes (with or without the leading %) and an optional array as third parameter. The hidden metacommand will generate hidden fields for all data contained in the first hash but not in the second hash. The default used for the first hash is %fdat, %idat is used for the second.
If the third parameter is specified, the fields are written in the order they appear in this array. That is, all keys of the first hash must be properly sorted in this array. This is intended for situations where you want to pass data from one form to the next, for example, two forms which should be filled in one after the other. (Examples might be an input form and a second form to review and accept the input, or a Windows-style "wizard"). Here you can pass along data from previous forms in hidden fields. (See eg/x/neu.htm for an example.) If you use just the 'hidden' command without parameters, it simply generates hidden fields for all form fields submitted to this document which aren't already contained in another input field.
Example:
<FORM ACTION="inhalt.htm" METHOD="GET">
<INPUT TYPE="TEXT" NAME="field1">
[$ hidden $]
</FORM>
If you request this with
http://host/doc.htm?field1=A&field2=B&field3=C
the output will be
<FORM ACTION="inhalt.htm" METHOD="GET">
<INPUT TYPE="TEXT" NAME="feld1" VALUE="A">
<INPUT TYPE="HIDDEN" NAME="field2" VALUE="B">
<INPUT TYPE="HIDDEN" NAME="field3" VALUE="C">
</FORM>
NOTE: this is only for a small amount of data, bestie, because the hidden fields get shipped off to the browser, and the browser ships them right back with the next request. Got a big pile of data? Store it in a file with a unique name and send only the filename in the hidden field. And please be aware β the data can be changed by the browser if the user doesn't behave exactly how you expect. Users have a nasty habit of doing this all of the time π. Your program should be able to handle those situations properly. No cap.
varβ declares one or more variables for use inside this Embperl document and sets thestrictpragma. You hand it the variable names as a space-separated list.
Example:
[$var $a %b @c $]
Which is literally the same as writing this in normal Perl:
use strict ;
use vars qw($a %b @c) ;
NOTE 1: use strict inside an Embperl document will only apply to the block in which it occurs.
sub(only Embperl 1.2b5 and above β¨) β defines an Embperl subroutine. Example:
[$ sub foo $]
<p> Here we do something </p>
[$ endsub $]
You can call this subroutine either as a normal Perl subroutine
[- foo -]
or through the Embperl::Execute function.
[- Execute ('#foo') # short form -]
[- Execute ({ sub => 'foo'}) # long form -]
The difference is that the Execute function will reset the internal states of Embperl like they were before the subroutine call, when the subroutine returns. π«Ά
You may also pass parameters to the subroutine:
[$ sub foo $]
[- $p = shift -]
<p> Here we show the first parameter [+ $p +]</p>
[$ endsub $]
[- foo ('value') -]
In Embperl 2.0.2 and up you can use a shortcut syntax for passing parameters:
[$ sub foo ($p) $]
<p> Here we show the first parameter [+ $p +]</p>
[$ endsub $]
This behaves the same as the example above, but in addition the parameters defined this way are lexically scoped and therefore only available inside the subroutine. clean girl behavior π§Ό
In addition you can define some initial Perl code for the subroutine:
[$ sub foo ($a, $b)
my $c = $a + $b ;
$]
<p> The result is [+ $c +]</p>
[$ endsub $]
If you have a couple of commonly used subroutines you can define them in one file and import them into the modules where they are necessary:
[- Execute ({ inputfile => 'mylib.htm', import => 1 }) -]
This will import all subroutines from the file mylib.htm into the current page, where they can be called just like a normal Perl subroutine.
dumpβ Embperl 2.1.1 and above.
dump can be used to output the values of variables either to the output or to logfiles. The first parameter specifies the output channel:
outβ output to the page outputpreβ same asout, but surrounded with a<pre>tag. This is the default, if the output parameter is omitted.logβ output to embperl log fileerrβ output to stderr, which normally goes to the httpd error log.
If the output parameter is omitted, pre is assumed.
The following parameter can be a literal text (in quotes) or a list of variables.
Example:
[$ dump err 'dump test', %fdat $]
[$ dump %fdat, $i, @array $]
π HTML Tags π
Embperl recognizes the following HTML tags in a special way. All others are simply passed through, as long as they are not part of an Embperl command.
π TABLE, /TABLE, TR, /TR
Embperl can generate dynamic tables (one- or two-dimensional). You only need to specify one row or column. π
Embperl generates as many rows or columns as necessary. This is done by using the magic variables $row, $col, and $cnt. If you don't use $row/$col/$cnt within a table, Embperl does nothing and simply passes the table through.
Embperl checks if any of $row, $col, or $cnt is used. Embperl repeats all text between <table> and </table>, as long as the expressions in which $row or $cnt occurs are defined.
Embperl repeats all text between <tr> and </tr>, as long as the expressions in which $col or $cnt occurs are defined.
See also $tabmode (below) for end-of-table criteria.
Examples: (see eg/x/table.htm for more examples)
[- @k = keys %ENV -]
<TABLE>
<TR>
<TD>[+ $i=$row +]</TD>
<TD>[+ $k[$row] +]</TD>
<TD>[+ $ENV{$k[$i]} +]</TD>
</TR>
</TABLE>
This will show all entries in array @k (which contains the keys from %ENV), so the whole environment is displayed (as in the while example), with the first column containing the zero-based index, the second containing the content of the variable name, and the third the environment variable's value. β¨
This could be used to display the result of a database query if you have the result in an array. You may provide as many columns as you need. It is also possible to call a fetch subroutine in each table row.
π¦ DIR, MENU, OL, UL, DL, SELECT, /DIR, /MENU, /OL, /UL, /DL, /SELECT
Lists and dropdowns or list boxes are treated exactly as one-dimensional tables. Only $row, $maxrow, $col, $maxcol and $tabmode are honored. $col and $maxcol are ignored. See eg/x/lists.htm for an example.
πΈ OPTION
Embperl checks if there is a value from the form data for a specific option in a menu. If so, this option will be pre-selected. π
Example:
<FORM METHOD="POST">
<P>Select Tag</P>
If you request this document with list.htm?SEL1=x
you can specify that the element which has a value
of x is initially selected
<P><SELECT NAME="SEL1">
<OPTION VALUE="[+ $v[$row] +]">
[+ $k[$row] +]
</OPTION>
</SELECT></P>
</FORM>
π INPUT
The INPUT tag interacts with the hashes %idat and %fdat. If the input tag has no value and a key exists with the same text as the NAME attribute of the input tag, Embperl will generate a VALUE attribute with the corresponding value of the hash key. All values of <INPUT> tags are stored in the hash %idat, with NAME as the hash key and VALUE as the hash value. Special processing is done for TYPE=RADIO and TYPE=CHECKBOX. If the VALUE attribute contains the same text as the value of the hash the CHECKED attribute is inserted, else it is removed. π
So, if you specify, as the ACTION URL, the file which contains the form itself, the form will be redisplayed with same values as entered the first time. (See eg/x/neu.htm for an example.)
π TEXTAREA, /TEXTAREA
The TEXTAREA tag is treated exactly like other input fields.
β META HTTP-EQUIV=
<meta http-equiv= ... > will over-ride the corresponding http header. This keeps Netscape from asking the user to reload the document when the content-type differs between the http header and the meta http-equiv. iconic, honestly
This can also be used to set http headers. When running under mod_perl http-headers can also be set by the function header_out
Example of how to set a http header:
<META HTTP-EQUIV="Language" CONTENT="DE">
This is the same as using the Apache function
[- $req_rec -> header_out("Language" => "DE"); -]
π A, EMBED, IMG, IFRAME, FRAME, LAYER
The output of perl blocks inside the HREF attribute of the A Tags and the SRC attribute of the other Tags are URL escaped instead of HTML escaped. (see also $escmode). Also, when inside such a URL, Embperl expands array and hash references to URL parameter syntax. Example:
[-
$A = { A => 1, B => 2 } ; # Hashreference
@A = (X, 9, Y, 8, Z, 7)
-]
<A HREF="http://localhost/tests?[+ $A +]">
<A HREF="http://localhost/tests?[+ \@A +]">
is expanded by Embperl to
<A HREF="http://localhost/tests?A=1&B=2">
<A HREF="http://localhost/tests?X=9&Y=8&Z=7">
π§ Variable scope and cleanup π§
The scope of a variable declared with my or local ends at the end of the enclosing [+/- ... -/+] block; the [+/- ... -/+] blocks act much like Perl's { ... } in that regard.
Global variables (everything not declared with my or local) will be undef'ed at the end of each request, so you don't need to worry about any old variables laying around and causing suspicious results. This is only done for variables in the package the code is eval'ed in β every variable that does not have an explicit package name. All variables with an explicit package name (i.e., in modules you use) will stay valid until the httpd child process dies. Embperl will change the current package to a unique name for every document, so the influence between different documents is kept to a minimum. You can set the name of the package with EMBPERL_PACKAGE. (See also "(Safe-)Namespaces and opcode restrictions".)
Since a CGI script is always a process of its own, you don't need to worry about that when you use Embperl as a CGI script.
If you need to declare variables which need to live longer than just one HTTP request (for example, a database handle), you must either put its name in the hash %CLEANUP or declare them in another package (i.e., $Persistent::handle instead of $handle).
If you want to use the strict pragma, you can do this by using the var metacommand to declare your variables.
NOTE: Because Apache::DBI has its own namespace, this module will work together with Embperl to maintain your persistent database connection. π«Ά
You can disable the automatic cleanup of global variables with EMBPERL_OPTIONS or the cleanup parameter of the Execute function.
You can define exceptions to the cleanup rule with the hash %CLEANUP.
If you like to do your own cleanup you can define a subroutine CLEANUP in your document. This will be called right before the variables are cleaned up, but after the connection to the client is closed. π§Ό
EXAMPLE:
[! sub CLEANUP { close FH ; } !]
π Predefined variables π
okay bestie, listen up β Embperl has a whole little squad of special variables that already mean something. You don't declare them, you don't fight them, they're just there, doing their thing. Let's meet the cast π
π %ENV π
Has all the environment stuff, exactly like a CGI script sees it.
π $epreq π
A reference to the Embperl request object, periodt. This is literally the same thing as slapping $epreq = shift at the very top of every single page.
π $epapp π
A reference to the Embperl application object. Same as what $epreq -" app> would give you back.
π %fdat π
This is the big one β every bit of form data the calling form sent to your script lives here. The NAME attribute builds the key, the VALUE attribute becomes the hash value. Embperl genuinely does not care whether it got called with GET or POST, but heads up: there can be limits on parameter length with GET β not from Embperl itself, but maybe from your web server, especially if you're in Embperl's CGI mode. So yeah, POST is the safer bet π«Ά
If a bunch of fields with the same name get sent to an Embperl page, they all land in the same hash element, separated by tabs. Split them into an array like this:
@array = split (/\t/, $fdat{'fieldname'}) ;
Embperl also supports ENCTYPE multipart/form-data, which is the vibe you need for file uploads. The entry in %fdat matching the file field will be a filehandle, just like with CGI.pm. (Embperl uses CGI.pm under the hood to process forms encoded with multipart/form-data.)
File upload example:
HTML page:
<FORM METHOD="POST" ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" NAME="ImageName">
</FORM>
Embperl ACTION:
[- if (defined $fdat{ImageName}) {
open FILE, "> /tmp/file.$$";
print FILE $buffer
while read($fdat{ImageName}, $buffer, 32768);
close FILE;
}
-]
Once you've installed CGI.pm 2.46 or above, you can also grab the filename (the local filename, the way it was on the browser's side) plus the info from the CGI.pm uploadInfo function. To get the filename, just print out the value of that %fdat entry instead of using it as a filehandle. And to get the uploadInfo, use the fieldname with a dash in front of it:
Example:
# ImageName is the NAME of the field, you must replace it with whatever
# name is given in your HTML code
Filename: [+ $fdat{ImageName} +] <br>
Content-Type: [+ $fdat{-ImageName} -> {'Content-Type'} +] <br>
NOTE: the way uploadInfos were accessed before 1.2b11 is not supported anymore. RIP to that era, we don't do it.
NOTE: it works the other way too, bestie β any input fields whose names are%fdatkeys, with no values, will get their values automatically set to the matching%fdatvalue. Peep "HTML Tags" "INPUT/OPTION/TEXTAREA".
π @ffld π
Every field name, in the order the browser sent them. Which is normally β but not necessarily β the order they show up in your form. Don't count on it being cute and predictable, it's giving chaos sometimes π
π %idat π
Every value from every input tag processed so far. All of them. Together.
π %udat (only 1.2b1 or higher) π
You can use %udat to store per-user data πΈ As long as you don't touch %udat, literally nothing happens. But the second you write anything into it, Embperl creates a session id and sends it to the browser via a cookie. The data you wrote into %udat gets stored by Apache::Session. Next time that same user requests an Embperl page, the browser sends the cookie with the session id back, and Embperl fills %udat from Apache::Session with the exact same values you stashed for that user. (Also see "Session handling")
π %mdat (only 1.2b2 or higher) π
%mdat is for per-module/page data β¨ Same deal as before β don't touch it, nothing happens. Write anything into it and Embperl creates a session id and stores the data via Apache::Session. Next time any user hits that same Embperl page, Embperl fills %mdat from Apache::Session with the same values you stored during the last request to that page. (Also see "Session handling")
π $row, $col π
Row and column counts, for use in dynamic tables. (See "HTML tag table".)
π $maxrow, $maxcol π
The maximum number of rows or columns to display in a table. To prevent endless loops, $maxrow defaults to 100 and $maxcol defaults to 10. (See "HTML tag table".)
π $cnt π
How many table cells have been displayed so far. (See "HTML tag table".)
π $tabmode π
This is the one that decides how Embperl figures out a dynamic table is done. Tables are always capped at whatever $maxrow and $maxcol say, but they can also end early when the row ($row) and column ($col) variables go undefined. Here's how $tabmode operates, bestie:
π $tabmode = 1
End table looping when any one of the expressions in the table row using $row returns undefined. The row containing that undefined expression is not displayed. Only the expressions that contain an access to the variable $row are watched. π
π $tabmode = 2
End when an expression with $row becomes undefined. The row containing the undefined expression is displayed.
π $tabmode = 4
End when $maxrow rows have been displayed.
end of row
π $tabmode = 16
End table column looping when any one of the expressions in the table column using $col returns undefined. The column containing the undefined expression is not displayed. Only expressions containing an access to the variable $col are watched.
π $tabmode = 32
End when an expression with $col becomes undefined. The column containing the undefined expression is displayed.
π $tabmode = 64
End when $maxcol columns have been displayed.
The default is 17, which is correct for all sort of arrays. You should rarely ever need to change it. And hey β the two values can be added together. Math slay π
π $escmode π
Turns HTML and URL escaping on and off. Default is on ($escmode = 3).
NOTE: normally you can disable escaping by putting a backslash in front of the item that would normally get escaped. Cute trick, right? Well... it can be VERY DANGEROUS in situations where content inserted by some user gets redisplayed, because they can enter arbitrary HTML and stick a backslash in front of it to dodge correct escaping when their input gets shown again π To dodge that problem, add 4 to the values below. That makes Embperl ignore the backslash entirely when it does output escaping at all. (only 1.3b4 and above)
NOTE 2: if you want to output binary data, you must set the escmode to zero. (only 1.3b6 and above)
$escmode = 8(or15) (2.0b4 and above) β the result of a Perl expression is always XML-escaped (e.g.,>becomes>and ' become ').$escmode = 3(or7) β the result of a Perl expression is HTML-escaped (e.g.,>becomes>) in normal text, and URL-escaped (e.g.,&becomes%26) within "A", "EMBED", "IMG", "IFRAME", "FRAME" and "LAYER" tags.$escmode = 2(or6) β the result of a Perl expression is always URL-escaped (e.g.,&becomes%26).$escmode = 1(or5) β the result of a Perl expression is always HTML-escaped (e.g.,>becomes>).$escmode = 0β no escaping takes place. at all. none. π
SEE ALSO: Configuration directive EMBPERL_INPUT_ESCMODE (was optRawInput in Embperl 1.3.x)
π $req_rec π
This variable only exists when you're running under the control of mod_perl. It holds the request record you need to access the Apache server API. Peep perldoc Apache2::RequestRec for more info.
π LOG π
This is the filehandle of the Embperl logfile. By writing print LOG "something" you can add lines to it. π₯
NOTE: the logfile line should always start with the pid of the current process, then continue with a four-character signature delimited by a :, which says what the log reason is.
Example: print LOG "[$$]ABCD: your text\n" ;
And if you're writing a module for use under Embperl, you can say
tie *LOG, 'Embperl::Log';
to get yourself a handle you can write to the Embperl logfile with. Iconic.
π OUT π
This filehandle is tied to Embperl's output stream. Printing to it does exactly the same thing as using the [+ ... +] block. (See also optRedirectStdout)
π @param π
Will be set up by the 'param' parameter of the Execute function. You can use it to pass parameters to an Embperl document and back. (see Execute for further docs)
π %http_headers_out (only 1.2b10 and above) π
You can shove any http headers you want to send into this hash. Go off π
If you set a location header, Embperl automatically sets the status to 301 (Redirect). Example:
[- $http_headers_out{'Location'} = "http://www.ecos.de/embperl/" -]
but plot twist β it's also possible to specify a two element array for Location, where the second element gives the HTTP status you actually want:
[- $http_headers_out{Location} = [ "http://www.ecos.de/embperl/", 303 ]; -]
Starting with version 1.3.2, all headers with the exception of "Content-Type" can take multiple values. So say you wanted to set two cookies, you'd go:
[- $http_headers_out{'Set-Cookie'} =
['name=cook1;value=2;','name=cook2;value=b'] ; -]
If you supply multiple values for "Location" or "Content-Type" via an array reference, then Embperl just uses the first one in the list. Empty arrays get ignored. So for instance, this one changes neither the status to 301 nor creates a Location: line in the HTTP headers:
[- $http_headers_out{'Location'} = [] ; -]
see also META HTTP-EQUIV=
π $optXXX $dbgXXX π
Every option (see "EMBPERL_OPTIONS") and every debugging flag (see "EMBPERL_DEBUG") can be read, and most of them can be set, through the matching variables. See "perldoc Config".
Example:
[- $dbgInput = 1 -]
[- $dbgInput = 0 -]
[+ $dbgCmd +] # Output the state of the dbgCmd flag
π %CLEANUP π
Embperl cleans up only the variables that are defined within the Embperl page. If you want it to clean up some extra variables too, just add them to the %CLEANUP hash β key is the variable name, value is one. And the other way around? You can stop Embperl from cleaning up certain variables by adding them to this hash with values of zero. Best of both worlds, honestly π
π %CLEANUPFILE (1.2b6+) π
Same purpose as %CLEANUP, but this time you can add filenames. Every variable defined inside that file will get cleaned up. bye bestie π¦
π Session handling π
okay bestie, listen up, this is the part where Embperl literally remembers your users for you β¨
From 1.2b1 and higher, Embperl is able to handle per-user sessions for you. You can stash literally any data in the %udat hash and if the same user requests an Embperl document again, you will see the same values in that hash again. no cap, it just remembers π§ π
From 1.2b2 and higher, Embperl is able to handle per-module/page persistent data for you. You can store any data in the %mdat hash and if any request comes to the same Embperl document, you will see the same values in that hash again. same energy, different hash π¦
β οΈ Session handling has changed from1.3.3to1.3.4and2.0b3to2.0b4. You must either installApache::SessionXor set
PerlSetEnv EMBPERL_SESSION_HANDLER_CLASS "Embperl::Session"
to get the old behaviour. If you have Apache::SessionX installed, you don't have to make additional configuration, otherwise you must do the following things. You are also able to override the Apache::SessionX defaults, by using the following parameters:
To configure Embperl to do session management for you, you must have installed Apache::Session (1.53 or higher) and tell Embperl which storage and locker classes you would like to use for Apache::Session. This is done by setting the environment variable EMBPERL_SESSION_CLASSES. that's the vibe check for your storage setup β¨
If you want to use a MySQL database for storing your sessions, you may have a startup.pl for your httpd which looks like this:
BEGIN
{
$ENV{EMBPERL_SESSION_CLASSES} = "MySQL Semaphore" ;
$ENV{EMBPERL_SESSION_ARGS} = "DataSource=dbi:mysql:session UserName=test" ;
} ;
use Embperl ;
or you may put this in the httpd/srm.conf:
PerlSetEnv EMBPERL_SESSION_CLASSES "MySQL Semaphore"
PerlSetEnv EMBPERL_SESSION_ARGS "DataSource=dbi:mysql:session UserName=test"
PerlModule Embperl ;
Refer to the Apache::Session docs (e.g. Apache::Session::Store::MySQL) on how to setup your database tables. ποΈ
EMBPERL_SESSION_ARGS is a space separated list of name/value pairs, which gives additional arguments for Apache::Session classes.
Here is an example for using a filesystem based storage:
PerlSetEnv EMBPERL_SESSION_CLASSES "File Semaphore"
PerlSetEnv EMBPERL_SESSION_ARGS "Directory=/path/to/your/sessions"
Refer to the Apache::Session docs to find out which other storage/locker methods are available. π
EMBPERL_SESSION_CLASSES can (optionally) take two more classnames, which specify the class for serialization (Default: Storable) and for generating the id (Default: MD5). two extra slots, lowkey sneaky π
π NOTE: The above configuration works only withApache::Session 1.52andEmbperl 1.3b5or above. Older versions of Embperl only supportApache::Session 1.0x, which has different parameters forEMBPERL_SESSION_CLASSES(e.g.$ENV{EMBPERL_SESSION_CLASSES} = "DBIStore SysVSemaphoreLocker" ;).Apache::Session 1.0xstill works with this Embperl version.
Now you are able to use the %udat and %mdat hashes for your user/module sessions. As long as you don't touch %udat or %mdat, Embperl will not create any session, and Apache::Session is not loaded. it literally waits for you to make the first move π As soon as you store any value to %udat, Embperl will create a new session and send a cookie to the browser to maintain its id, while the data is stored by Apache::Session. (Further version may also be able to use URL rewriting for storing the id). When you modify %mdat, Embperl will store the data via Apache::Session and retrieve it when the next request comes to the same page. πͺ
π Functions/Methods for session handling π
Embperl::Req::SetupSession ($req_rec, $uid, $sid, $app_param) [1.3b6+]
This can be used from a script that will later call Embperl::Execute to preset the session so it's available to the calling script. prep the session before the main character arrives β¨
$req_recβ Apache request record when running under mod_perl,undefotherwise.$uidβ Session ID of the user session. If not given it is taken from the session cookie or out of thequery_string.$sidβ Session ID of the state session. If not given it is taken out of thequery_string.$app_paramβSetupSessiontries to figure out the correctApplicationobject for this request, in case this is not possible you can pass parameters for theApplicationobject as a hash ref. To pass the name of the application object to use, try to pass:
{ appname => 'myappname' }
Returns a reference to %udat or, if call in an array context, a reference to %udat %mdat and %sdat. See also "CleanupSession". π«Ά
Embperl::Req::GetSession / $r -> GetSession [1.3b6+]
Returns a reference to %udat or, if called in an array context, a reference to %udat and %mdat. This could be used by modules that are called from inside an Embperl page, where the session management is already setup. If called as a method $r must be a Embperl::Req object, which is passed as first parameter to every Embperl page in @_. π
Embperl::Req::CleanupSession ($req_rec, $app_param) [1.3b6+]
Must be called at the end of a script by scripts that use SetupSession, but do not call Embperl::Execute. cleanup era, we love to see it π§Ή
$req_recβ Apache request record when running under mod_perl,undefotherwise.$app_paramβCleanupSessiontries to figure out the correctApplicationobject for this request, in case this is not possible you can pass parameters for theApplicationobject as a hash ref. To pass the name of the application object to use, try to pass:
{ appname => 'myappname' }
Embperl::Req::DeleteSession / $r -> DeleteSession [1.3b6+]
Deletes the session data and removes the cookie from the browser. gone, deleted, not coming back π If called as a method $r must be a Embperl::Req object, which is passed as first parameter to every Embperl page in @_.
Embperl::Req::RefreshSession / $r -> RefreshSession [1.3b6+]
Triggers a resend of the cookie. Normally the cookie is only sent the first time. If called as a method $r must be a Embperl::Req object, which is passed as first parameter to every Embperl page in @_. πͺβ¨
Embperl::Req::SetSessionCookie ($req_rec, $app_param) [1.3b7+]
Must be called by scripts that use SetupSession, but do not call Embperl::Execute. This is necessary to set the cookie for the user session id, in case a new session is created, which is normally done by Embperl::Execute. π
SetSessionCookie does only set the cookie for the user session and it works only when running under mod_perl. It does not set session id if no cookies are used. Also it does not care about the state session. fr fr, it's picky like that π
$req_recβ Apache request record when running under mod_perl,undefotherwise.$app_paramβSetupSessionCookietries to figure out the correctApplicationobject for this request, in case this is not possible you can pass parameters for theApplicationobject as a hash ref. To pass the name of the application object to use, try to pass:
{ appname => 'myappname' }
π Recipes π
Starting with 2.0b4 Embperl introduces the concept of recipes. A recipe basically tells Embperl how a component should be build. While before 2.0b4 you could have only one processor that works on the request (the Embperl processor β you're also able to define different syntaxes), now you can have multiple of them arranged in a pipeline or even a tree. π³β¨
While you are able to give the full recipe when calling Execute, this is not very convenient, so normally you will only give the name of a recipe, either as parameter 'recipe' to Execute or as EMBPERL_RECIPE in your httpd.conf. Of course you can have different recipes for different locations and/or files. π
A recipe is constructed out of providers. A provider can either be read from some source or do some processing on a source. There is no restriction on what sort of data a provider has as in- and output β you just have to make sure that output format of a provider matches the input format of the next provider. it's giving relay race energy πββοΈ
In the current implementation Embperl comes with a set of built-in providers:
fileβ read file datamemoryβ get data from a scalarepparseβ parse file into a Embperl tree structureepcompileβ compile Embperl tree structureeprunβ execute Embperl tree structureeptostringβ convert Embperl tree structure to stringlibxslt-parse-xmlβ parse xml source for libxsltlibxslt-compile-xslβ parse and compile stylesheet for libxsltlibxsltβ do an xsl transformation via libxsltxalan-parse-xmlβ parse xml source for xalanxalan-compile-xslβ parse and compile stylesheet for xalanxalanβ do an xsl transformation via xalan
There is a C interface, so new custom providers can be written, but what makes it really useful is that the next release of Embperl will contain a Perl interface, so you can write your own providers in Perl. π
The default recipe is named Embperl and contains the following providers:
+-----------+
+ file +
+-----------+
|
v
+-----------+
+ epparse +
+-----------+
|
v
+-----------+
+ epcompile +
+-----------+
|
v
+-----------+
+ eprun +
+-----------+
This cause Embperl to behave like it has done in the past, when no recipes existed. classic behaviour, main character energy, we stan π
Each intermediate result could be cached. So for example you are able to cache the already parsed XML or compiled stylesheet in memory, without the need to reparse/recompile it over and over again. cache it once, flex forever π₯
Another nice thing about recipes is that they are not static. A recipe is defined by a recipe object. When a request comes in, Embperl calls the get_recipe method of the application object, which by default calls the get_recipe of the named recipe object, which should return a array that describes what Embperl has to do. The get_recipe methods can of course build the array dynamically, looking, for example, at the request parameters like filename, formvalues, mime type or whatever. π§
For example if you give a scalar as input the Embperl recipe replaces the file provider with a memory provider. Additionally you can specify more then one recipe (separated by spaces). Embperl will call all the new methods in turn until the first one that returns undef. This way you can create recipes that are known for what they are responsible. One possibility would be to check the file extension and only return the recipe if it matches. Much more sophisticated things are possible... the possibilities are literally endless bestie π¦β¨
See perldoc Embperl::Recipe for how to create your own provider. π
π XML, XSLT π
So, like, Embperl has a whole provider for doing XSLT transformations now (we mentioned it up top, bestie, keep up π ). More XML is coming in future releases, so consider this the preview era. The easiest way to do the XSLT thing is through the predefined recipes:
EmbperlLibXSLTβ the result of Embperl will run thru the Gone libxslt β¨EmbperlXalanXSLTβ the result of Embperl will run thru Xalan-C π₯EmbperlXSLTβ the result of Embperl will run thru the XSL transformer given byxsltprocorEMBPERL_XSLTPROCLibXSLTβ run source thru the Gone libxslt π¦XalanXSLTβ run source thru Xalan-CXSLTβ run source thru the XSL transformer given byxsltprocorEMBPERL_XSLTPROC
Okay so, imagine you wanna shove the result of an XSLT transformation into your html page. It's giving:
<html><head><title>Include XML via XSLT</title></head>
<body>
<h1>Start xml</h1>
[- Execute ({inputfile => 'foo.xml', recipe => 'EmbperlXalanXSLT', xsltstylesheet => 'foo.xsl'}) ; -]
<h1>END</h1>
</body>
</html>
And yeah, you already guessed it (main character intuition π), the xsltstylesheet parameter gives the name of the xsl file. You can also use the EMBPERL_XSLTSTYLESHEET configuration directive to set it from your configuration file. No cap.
Also: by setting EMBPERL_ESCMODE (or $escmode) to 15 you get the correct escaping for XML. Iconic, honestly.
π Form Validation π
Embperl comes with the ability to validate form data, which is lowkey a whole superpower. Rules can be defined for how the data from forms should be validated. This is done by the module Embperl::Form::Validate. This module is able to do client side verification by generating JavaScript code and server side verification by providing a Perl method to validate the data.
Embperl::Form::Validate comes with a lot of standard tests and you can extent it by providing your own test classes, which can inherit from the shipped test classes. Obsessed π«Ά.
For further details see perldoc Embperl::Form::Validate.
β Caching β
Embperl caches a lot of intermediate results by default to speed up generation of pages. (For example compiled Perl code and compiled XSLT templates.)
With Embperl is also possible to cache the output of pages or components. This is controlled by parameters passed to the providers via recipes or as configuration directives inside the page, passed to Execute or in your httpd.conf.
See Emperl_Cache_* and Embperl_Expires_* in Config.pod.
π Internationalisation (I18N) π
Starting with 2.0b6 Embperl has buildin support for multi-language applications. There are two things to do. First inside your pages marks which parts are translateable, by using the [= =]. Inside the [= =] blocks you could either put id, which are symbolic names for the text, or you put the text in your primary lanaguage inside the blocks. An example code could look like:
[= heading =]
<input name="foo" value="[=bar=]" type="submit">
Now you run the embpmsgid.pl utility, which extracts all the ids from your page:
perl embpmsgid.pl -l de -l en -d msg.pl foo.htm
This will create a file msg.pl which contains empty definitions for 'en' and 'de' with all the ids found in the page. If the file msg.pl already exists, the definitions are added. You can give more then one filename to the commandline. The format of the msg.pl file is written with Data::Dumper, so it can be easily read in via 'do' and postprocessed. As next step fill the empty definition with the correct translation. The last thing to do, is tell Embperl which language set to use. You do this inside the init method of the application object. Create an application object, which reads in the message and when the init method is called, pass the correct one to Embperl.
There are tow methods $r -> message and $r -> default_message. Both returns a array ref on which you can push your message hashs. Embperl consults first the message array and if not found afterwards the default_message array for the correct message. Because both are arrays you can push multiple message sets on it. This is handy when your application object calls it's base class, which also may define some messages.
Starting with version 2.3.0 it is also possible, to add a code ref instead of a hash ref to the arrays. The code is than called with the key as argument and must return the translated text.
Here is an example:
package My::App ;
@ISA = ('Embperl::App') ;
%messages =
(
'de' =>
{
'heading' => '\[:U]berschrift',
'bar' => 'Absenden',
},
'en' =>
{
'heading' => 'Heading',
'bar' => 'Submit',
},
) ;
sub init
{
my $self = shift ;
my $r = $self -> curr_req ;
$lang = $r -> param -> language || 'de' ;
push @{$r -> messages}, $messages{$lang} ;
push @{$r -> default_messages}, $messages{'en'} if ($lang ne 'en') ;
}
# Code ref works too...
@{$r -> messages} = (\&ecos::I18L::translate::gettext) ;
# and gettext is defined as
sub gettext
{
my ($key) = @_ ;
return "translated text" ;
}
1 ;
Just load this package and set EMBPERL_APP_HANDLER_CLASS to My::App, then Embperl will call the init method on the start of the request. Slay.
If you are using Embperl::Object, you may instead save it as a file in your document hiearchie make the filename know to Embperl::Object with the EMBPERL_OBJECT_APP directive and Embperl::Object will retrieve the correct application file, just in the same way it retrieves other files.
NOTE: When using withEmbperl::Object, don't make a package declaration at the top of your application object,Embperl::Objectassign it's own namespace to the application object. Don't do it, bestie, it will not go well π
In case you need to retrieve a text inside your Perl code, you can do this with $r -> gettext('bar').
π¦ Encoding/UTF-8 π¦
Requires Embperl 2.1.0 and up.
Embperl tries to do the right thing to handle ISO-8859-1 and UTF-8 out of the box. There are three places where encoding comes into places:
- Posted form data
- Output escaping
- Source code
While the first two things are handled by Embperl itself, the third item is currently left to handle by Perl. iykyk
Perl carries for each string value a flag that tells if the string is UTF-8 or not. Embperl uses this flag.
Posted form data is examined. If a string contains valid UTF-8 characters Perl's internal UTF-8 flag is set. You can disable setting the UTF-8 flag by setting "optFormDataNoUtf8" in "EMBPERL_OPTIONS".
Output escaping is done based on the UTF-8 flag. In case the UTF-8 flags is set characters above 127 are not escaped. To get the correct appearance in your browser you also have to specify the encoding as UTF-8 in your content-type http header.
If the UTF-8 flag is not set the output escaping is done based on the setting of "EMBPERL_OUTPUT_ESC_CHARSET", which defaults to ISO-8859-1 (latin1). ISO-8859-2 (latin2) is also selectable.
If you wish to have your Perl source code in UTF-8, you have to add a "use utf8;" at the top of each page.
Please note that not all modules sets Perl's internal UTF-8 flag correctly. At the time of this writing for exampleDBIandNet::LDAPdoes not set this flag. You have to correct it manualy, for example by using"Encode::_utf8_on". Fr fr, watch out for that one π
π₯ Error trapping π₯
When an error occurs inside an Embperl page, Embperl will display an error page, containing the error message.
Sometimes you want to have a different behaviour. One possibility is to let Apache display a custom error page (of course only when you run under mod_perl).
To get this working you need to set the option "optReturnError" (262144) in your httpd.conf in the "EMBPERL_OPTIONS" directive.
With this option set, Embperl sends no output in case of an error. It returns the error back to Apache or the calling program. When running under mod_perl this gives you the chance to use the Apache ErrorDocument directive to show a custom error-document. Inside the ErrorDocument you can retrieve the error messages with
$errors = $req_rec -> prev -> pnotes('EMBPERL_ERRORS') ;
where $errors is a array reference.
If you want to trap exceptions in a Embperl document, that you call via Execute, you can do this by passing an array to Execute, which receives all error/warning messages and/or all error objects.
[-
Execute ({inputfile => 'foo.epl', errors => \@errors}) ;
-]
[$if @errors$]
The following errors had occurred:<br>
[$foreach $err (@errors)$]
[+ $err +]<br>
[$endforeach$]
[$endif$]
In case you call "die" inside the executed page and pass an object (or a reference) to "die" instead of a string this will also show up in @errors. The last object passed to "die" is also available via "$epreq -" errobj>.
"$epreq -" error> can be used to test if an error occurred so far during the current request. You can also set "$epreq -" error> to false to reset Embperl's internal error condition.
If the option "optReturnError" or an error array is passed to a component the error flag is reset after the execution of component.
If an error array is passed to a component, the errors inside the component are not added to the overall errors of the request and therefore will not cause Embperl to display an error page.
An more seldom used option is "optDisableEmbperlErrorPage" (2), which tells tells Embperl not to send its own errorpage in case of failure, but instead show as much of the page as possible. Errors are only logged to the log file. so you get the chaos version, not the tidy version, periodt β¨
π οΈ UTILITY FUNCTIONS π οΈ
Okay bestie, these are the little helper functions that just do things for you. No cap. π
π MailFormTo($MailTo, $Subject, $ReturnField) π
This one sends the content of the hash %fdat β in the exact order specified by @ffld β to the addressee in $MailTo, with the subject set to $Subject. If you pass $ReturnField, then the value of that formfield gets used as the Return-Path. Usually that's the field where the user types their email address. So like, the email knows who to reply to. Iconic. β¨
If you put this example code as the action in your form:
<FORM ACTION="x/feedback.htm" METHOD="POST"
ENCTYPE="application/x-www-form-urlencoded">
then the content of the form will be mailed to the given email address. Slay.
MailFormTo uses "EMBPERL_MAILHOST" as SMTP server, or localhost if none is given. Lowkey important. π¬
Example:
<HTML>
<HEAD>
<TITLE>Feedback</TITLE>
</HEAD>
<BODY>
[- MailFormTo('webmaster@domain.xy',
'Mail from WWW Form', 'email') -]
Your data has been successfully sent!
</BODY>
</HTML>
This will send an email with all the form fields to webmaster@domain.xy, with the Subject 'Mail from WWW Form', and will set the Return-Path of the mail to the address which was entered in the field with the name 'email'. The way that just works? Obsessed. π«Ά
NOTE: You must haveNet::SMTP(from thelibnetpackage) installed to use this function. NoNet::SMTP, no mail. Periodt. π
πͺ exit πͺ
exit will override the normal Perl exit in every Embperl document. Calling exit immediately stops any further processing of that file and sends the already-done work to the output/browser. It's giving "we're done here" energy. π
NOTE 1: If you are inside of an Execute, Embperl will only exit this Execute, but the file which called the file containing the exit with Execute will continue. So it's a local exit, not a global one. iykyk.
NOTE 2: If you called exit with an argument it exits the whole request e.g. exit (200). That's the full send. π₯
NOTE 3: If you write a module which should work with Embperl under mod_perl, you must use Apache::exit instead of the normal Perl exit (as always when running under mod_perl). Do not come for me, that's just how it is. π«
β‘ PERFORMANCE β‘
Okay so, vibe check: logging is not the moment. To get the best performance from Embperl, it is necessary to restrict logging to a minimum. You can drastically slow down Embperl if you enable all logging options. (This is why make test takes a while to run.) You should never enable dbgFlushOutput or dbgFlushLog in a production environment. More debugging options are useful for development where it doesn't matter if the request takes a little bit longer, but on a heavily-loaded server they should be disabled. Like, read the room. π«
Preloading of page can save memory, because preloaded page can be shared between child processes. See "perldoc Config" for more details. Memory? Saved. We love to see it. π
Also take a look at mod_perl_tuning.pod for general ideas about performance. Go off, bestie. π
π BUGS π
None known. And that's on periodt. β¨
π§ͺ COMPATIBILITY π§ͺ
I have tested Embperl successfully:
π§ on Linux 2.x/3.x with π§
perl5.005_03,5.6.x,5.8.x,5.10.x,5.12.x,5.14.x,5.16.x,5.18.xapache_1.3.0 - apache_1.3.31,apache 2.0.x,apache 2.2.x,apache 2.4.xapache_ssl (Ben SSL)Stronghold 2.2Stronghold 2.4.1Apache_1.3.x with mod_ssl 2.x.x
I know from other people that it works on many other UNIX systems. So if your setup is weird and wonderful, there's hope. π
πͺ on Windows NT 4.0 with πͺ
perl5.004_04perl5.005perl5.6.1perl5.8.xapache_1.3.0 - apache_1.3.31
πͺ on Windows 95/98 with πͺ
perl5.004_02(binary distribution, only Offline Mode)perl5.005_02 + apache_1.3.6
π«Ά SUPPORT π«Ά
π¬ Feedback and Bug Reports π¬
Please let me know if you use or test this module. Bugs, questions, suggestions for things you would find useful, etc., are discussed on the Embperl mailing list. If you have a site that is using Embperl, I would love to mention it in list of sites using Embperl. Please drop me a mail with a short description, if your site uses Embperl. Fr fr, they wanna hear from you. π
The Embperl mailing list (embperl@perl.apache.org) is available for Embperl users and developers to share ideas, solve problems and discuss things related to Embperl. To subscribe to this list, send mail to embperl-subscribe@perl.apache.org. To unsubscribe send email to embperl-unsubscribe@perl.apache.org .
There is an archive for the Embperl mailing list at http://mail-archives.apache.org/mod_mbox/perl-embperl
For mod_perl related questions you may search the mod_perl mailing list archive at http://mail-archives.apache.org/mod_mbox/perl-modperl
πΌ Commerical Support πΌ
You can get free support on the Embperl mailing list (see above). If you need commercial support, ecos can provide it for you. We offer:
- Consulting and assistance for you and your programmers
- Planning of your dynamic website
- Creating of parts or a whole website
- Fixing bugs in Embperl (also available for mod_perl)
- Adding new features
You can reach us via http://www.ecos.de or info@ecos.de
π± How to Support the Development of Embperl π±
If you use and like Embperl and want to support it's ongoing development you have two possibilities:
- Send me patches for things you like to see in Embperl
- Donate money to Embperl. See
http://perl.apache.org/donate.htm - Buy commercial support (see above). Also you may get the same answers to your questions on the mailing list, by buying the commercial support you not only buy support for yourself and can be sure you get an answer, you also give us the possibility to put more power in the further development of Embperl.
π LINKS AND DOWNLOAD π
π Information π
mod_perlβhttp://perl.apache.org/Embperlβhttp://perl.apache.org/embperl/Embperl (german)βhttp://www.ecos.de/embperl/DBIx::Recordsetβhttp://search.cpan.org/~grichter/Apache web serverβhttp://www.apache.org/
β¬οΈ Download β¬οΈ
mod_perlβhttp://perl.apache.org/dist/- Apache Perl Modules β
http://www.perl.com/CPAN/modules/by-module/Apache/ Embperlβhttp://www.embperl.org/downloadsDBIx::Recordsetβhttp://search.cpan.org/~grichter/- PPM for ActiveState
- Perl 5.6.x β
http://theoryx5.uwinnipeg.ca/ppmpackages/ - Perl 5.8.x β
http://theoryx5.uwinnipeg.ca/ppms
- Perl 5.6.x β
Informations on how to install Embperl can be found in INSTALL.pod
ποΈ SVN ποΈ
The latest developments are available via SVN. Look at "perldoc SVN.pod" for a detailed description.
β¨ SYNTAXMODES FOR VARIOUS EDITORS β¨
π Emacs π
From: Erik Arneson [erik@mind.net]
Here's the amount of documentation I've got right now.
They need to get mmm.el from this URL: http://mmm-mode.sourceforge.net/
Then download my mmm-embperl.el from this one: http://www.aarg.net/erik/mmm-embperl.el
The documentation for using these is included in those two elisp files.
π VIM π
Vim Syntaxfile for Vim 5.x & 6.x from Lukas Zapletal with syntax highliting for JavaScript, VBScript, Perl+Embperl, CSS and HTML, yellow background for Perl`s code (like M$ Interdev) and working Perl folding can be found at http://vim.sourceforge.net/script.php?script_id=61
Vim Syntaxfile from Steve Willer can be found at http://www.interlog.com/~willer/embperl.vim
Vim Syntaxfile from Kee Hinckley can be found at http://www.somewhere.com/software/
π Dreamweaver π
Dreamweaver extension which tells Dreamweaver not to touch Embperl code can be found at http://www.somewhere.com/software/
π AUTHOR π
G. Richter (richter at embperl dot org)
π SEE ALSO π
perl(1), mod_perl, Apache httpd
this page came from perl v5.34.0, dated 2022-02-06, and it's the Embperl(3pm) manpage. mwah πβ¨
π¦ where this page comes from
- ubuntu jammy: libembperl-perl 2.5.0-16build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms