Next Previous Contents

1. Introduction

Pi3Perl is a perl embedding module for the Pi3Web Server, which provides direct access to the API functions of the Pi3Web Server from any perl code. The configured perl file will be loaded and evaluated, an initialization subroutine is called. Later the execute subroutine is called during request handling phase. The perl code can use callbacks to all Pi3 API functions through the Pi3:: perl module.

Perl Server Pages (PSP) is an embedded script language, which allows to mix Perl code with any tag language (HTML) pages. You can either use scriptlets to execute embedded perl code, expressions to write dynamic output or directives to include subsequent PSP files. Pi3Perl is similar to Java Servlet API and PSP is similar to JSP. For further information regarding PSP refer to the PSP language specification v0.5.

Although Pi3Perl and PSP are indeed similar, there are also some differences:

  1. Pi3Perl scripts contain only perl, just like other perl scripts, PSP contains plain tag language text with embedded PSP tags containing perl code
  2. Pi3Perl scripts are parsed on server startup, PSP scripts are parsed prior they are used for the first time
  3. The perl subroutines, which are configured as "init" and "execute" parameter values will be called in a Pi3Perl script. The PSP routines pspLoad(), pspUnLoad and pspSetResponse() will be executed if they exist in a PSP scriptlet.
  4. Pi3Perl code is simply executed. To write data back to the client, the Pi3:: package provides access to the Pi3Web server API's. PSP scriptlets are also executed but expressions are evaluated and directly written back to the client.

You should use Pi3Perl if:

You should rather use PSP if:

In each case you should like the Perl language ;-). By the way, Pi3Perl and PSP aren't required to run Perl based CGI with Pi3Web. They provide a way to

Next Previous Contents