Overview Download Installation Docs Tutorial Credits Page Source Hosted by: Convolution |
Choose: PLP PLP::Functions PLP::Fields PLP::FAQ PLP::HowTo NAMEPLP::FAQ - Frequently Asked Questions about PLP
FAQ
PerlPage. The name used to be HTMPL, but HyperText Markup with Perl Language was too long.
No, it actually is very simple and easy. Quick startup hints are in the PLP main documentation, extensive installation instructions are on the PLP website.
Yes, it is. But when you get used to Perl, you will probably dislike PHP for the rest of your life. Perl is faster and far more powerful. For both Perl beginners and more advanced Perl coders, PerlMonks is a good Perl forum community. (Please note: PLP is not Perl. Perl is a complete programming language and is not restricted to web based applications. PLP uses Perl, but many people use Perl without PLP.
Yes. As of 3.00, PLP can be used with mod_perl! And it's very fast!
PLP can be used for quick-and-dirty hacks in a way similar to PHP. However, it is suitable for larger applications as well. You can use strict if you want. mod_perl Users might like to know that globals are automatically destroyed (as long as you do not switch packages).
With mod_perl or FastCGI, PLP is a lot faster than with CGI. Instead of executing a new perl process for each request, the same interpreter will serve multiple pages.
Well, you already have scripts that probably are faster than PHP equivalents, but speed maniacs always want more. Modules are cached, so with a proper module design, you can add a little more speed.
You certainly can! If you do not want %get and %post and the like, just don't use them. They will be generated on first access, so if you never access them, the hashes are never filled. If you want to use CGI.pm's header functions, select STDOUT; first, to break out of PLP's tied PLPOUT filehandle.
<(...)> is a compile-time tag, opposed to include(), which is evaluated at run-time. At compile time, variables are not yet known, and PLP will try to include a file literally called $filename.
<: $filename = 'foo.inc.plp'; include($filename); :>
That is because your variable is lexical (declared with my), and the file is evaluated in its own scope, just as with Perl's built-in do and require. You can pass variables through subroutine parameters or by using globals variables. Another solution is using PLP's <(...)> tag.
Because it places the external file is placed inside of the other, before the code is executed (at compile-time).
These blocks are executed when the interpreter stops, which only occurs if you are running as CGI. To catch the exit of a PLP script, use PLP_END blocks instead. Please note that PLP_END is a normal statement, so you may need a semicolon.
<html><body>
You can not disable compile-time errors (syntax errors), but you can disable run-time errors. To do so, set the 0-bit (1) of $PLP::DEBUG off. If you only want error reporting disabled for a single command, use Perl's eval BLOCK function (not eval "", but eval {}, which is not slow or insecure.).
<: $PLP::DEBUG &= ~1; :>
Yes, you can! Of course, you can not override compile-time errors like syntax errors, but run-time error messages use $PLP::ERROR, which is a reference to a sub that gets two arguments: the error message itself, and an html-encoded version.
<:
There is. Set $PLP::DEBUG's 1-bit (2), and it will output a plain text header before outputting the other one.
<: $PLP::DEBUG |= 2; :>
| |