Introduction

This is the “official” documentation for PET -- a (web) programming framework and application server for Perl.

Summary
IntroductionThis is the “official” documentation for PET -- a (web) programming framework and application server for Perl.
What is PET anyway?PET is a WEB programming framework / application server written in Perl, which means it is a software that helps programmers to create web-based applications.
FeaturesPET provides many freatures for developers.
Getting PETPET will later be distributed as a standard CPAN module.
Current stage of developmentAt the time of writing (well, actually modifying) this (December, 2008), PET is more than three years old.
Contribute!Obviously, you can help making PET succesful and evolve! 
Author(s)PET was created by Csongor Fagyal (CPAN author-id : FAGZAL -- http://search.cpan.org/~fagzal/).

What is PET anyway?

PET is a WEB programming framework / application server written in Perl, which means it is a software that helps programmers to create web-based applications.  It is highly configurable, easy to use, and is flexible enough to be used as “a framework for creating frameworks”.

PET usually runs as a separate process (daemon).  Request reaching a PET website are (at least partially) served by the webserver (these are mostly request for static files, e.g. images), and partially by the PET application server (dynamic content -- (X)HTML pages).

If you know Tomcat for Java (http://tomcat.apache.org), for example, then you can imagine what PET is mostly good for and look like -- or you can think of the language PHP (http://www.php.net), the Python application server Zope (http://www.zope.org) or even more likely the CPAN module Apache::ASP (http://www.apache-asp.org).

However, if all the above description did not make any sense to you, don’t worry : instead, take a look at the Hello, World! examples which will pretty much show you how a basic program looks like under PET.  (Actually you should check out the “Hello, World!” examples even if you know what an application server looks like.)

PET can be used in three ways

  • Using the linear programming model (see: Hello, World-1!) you simply embed Perl and TT (see: http://templatetoolkit.org) commands in your HTML files, which this way can become dynamic (this is very similar to using PHP, Apache::ASP, JSP -- and so on -- please refer to http://en.wikipedia.org/wiki/Server-side_scripting).  This is the most basic and easiest way to use and learn PET.  Actually, you do not even need to know Perl to use PET this way.
  • Using Filters, especially XML mapping to make your life easier, using extended XML-like markup in your pages.  This is something similar to Tag Libraries in JSP ( http://en.wikipedia.org/wiki/Tag_library#JSP_Tag_Libraries ), but more “perl-ish”.
  • Using the MVC model (see: <MVC-style programming>) uses your .pet files as simple templates, and gives you the extraordinary power of a full-blown application server, making you to be able to quickly create professional, modular, high speed web applications with reuseable components.

You can actually mix these three approaches, emphasis put on MVC-style programming.

Features

PET provides many freatures for developers.

  • request resolution (automatic method invocation)
  • templating (using Template Toolkit)
  • debugging and testing aid (logs, command line execution, testing)
  • profiling (by measuring wallclock and cpu execution times)
  • utility modules and functions (form fillin, SQL handling, image manipulation, etc.)
  • increased security (running as a low privileged user, even chrooting in extreme cases)
  • dynamic runtime reloading (no need to restart your application while developing)
  • multilingual support (one that actually works!)
  • session handling (with session-plugins)
  • more than a hundred configuration options (“do not subclass -- configure!”)
  • lots of DWIMmery
  • chainable filters
  • ...and much more!

PET is FREE.  (See the <PET license>).

Getting PET

PET will later be distributed as a standard CPAN module.  However, that distribution is not yet ready.  For the time beeing, please check out Installing PET!

Current stage of development

At the time of writing (well, actually modifying) this (December, 2008), PET is more than three years old.  It has been powering some high traffic, high availability, multilingual commercial websites for quite some time now (e.g.  http://www.hungirly.com, http://www.coolcamels.com, http://www.kepeslap.com are some examples), so it is relatively robust and error free.  However, releasing PET was not out first priority before, so this distribution should be regarded as the first alpha version.  It is only an early release, which is provided here in order to help those who already use or want to try PET.  We are currently aiming towards a beta release, but that will not happen very soon, as many parts of PET still have to be constructed -- most importantly, interface (method) names and configuration parameters must be finalized and documented first (once “officially” released, PET will try to be as compatible with older releases as possible).  Some (not too much) refractoring of the codebase is also needed.  Also see : TODOs.  (It is very important to add here that during its history, PET has never had to be rewritten -- only tuned, extended, some parts refractored, which shows that the original design and conception are pretty much good.)

Contribute!

Obviously, you can help making PET succesful and evolve!  Take a look at the TODOs, and volunteer!  If you know some Perl, and has a few free hours, there are definetely many small (and not so small) items where you can provide some help -- even telling the developers your experiences and feature requests would be great.

Author(s)

PET was created by Csongor Fagyal (CPAN author-id : FAGZAL -- http://search.cpan.org/~fagzal/).

Please see : http://www.conceptoline.com, http://csongor.fagyal.com, http://pet.fagyal.com.

This documentation was created using NaturalDocs : http://www.naturaldocs.org, an excellent documentation kit.

So how does PET actually look like from the eye of the programmer?
There are many parts of PET that needs finishing, rewriting or fine-tuning.
Close