PTM Logo Version 0.5.1 Beta
Home    SVN    Downloads    Documentation    Forum    Contact
This Site is 100%
Powered by PTM Logo
What is PTM?
In short, PTM is a
Perl/HTML hybrid.
An inline develop-
ment language for
those that need a
bit more power
behind the

But more than that,
it allows develop-
ers to harness
Perl's ability to
manipulate strings
of text and iterate
loops many times
faster than other
languages on the
market without
the need to sacri-
fice development
time to complex
print, split, and join

Additionally, PTM
wraps many vari-
ables common to
PHP to ease the
transition between
PTM and PHP when
switching back and

PTM was not
created to replace
PHP or ASP. It was
designed to be a
complement to
them. Where one
fails another picks
up the slack. In the
world of dynamic
design we need all
the tools in our
toolbox to get the
job done. PTM is
the raw power
tool you've been
About PTM and This Site
This site will be one of hopefully many sites to be built along-side the PTM language. This is because this site is, in a manner of speaking, a public test for the language -- after all, how can we expect you to have confidence in a language we aren't using ourselves?

Additionally, this ensures that PTM is tested cross-platform, as the development mirrors are running Ubuntu Linux and Windows XP and, last we checked, SourceForge was hosting on Fedora Linux. As we make upgrades to the language, stable modifications will be uploaded to the site's back-end so we put our reputation on the line before you do. When enough stable modifications have been successfully put into place to constitute another distribution we'll release a new official version to the Downloads section.
Current Stable Release: 0.5.1 Beta
View README / Installation Instructions ( README )

Under the Hood: A Brief Explanation of How PTM Works
For you Perl programmers out that that want to know how PTM works before installing it, here's a quick run-down.

The PPA (Perl Parser Application) is installed to run as either an Apache plugin, a standalone parser for a specific user or directory, or is called via command line. When the PPA runs it expects to be given a *.ptm file to parse. This file is retreived via the PATH_TRANSLATED environment variable if in Apache-installed mode, a GET method field called "PTM_SCRIPT" or a mod_rewrite environment variable called "REDIRECT_PTM_SCRIPT" in standalone mode, both passed via the included ".htaccess" file, or via the command line (@ARGV).

Once a file has been specified to be parsed, that file's contents are read in and parsed in a linear fashion. During parsing, a Perl command set is created which is to be evaluated when parsing is complete. DO tag contents are passed directly into this command set. DISPLAY tag contents are wrapped in a print call and passed in. TEMPLATE, FILE, and NOHTML tag contents are evaluated to get a file name/path which is then read in and then either processed (in the case of TEMPLATE tags) or stored in the next free element of a print array named @_PTM. A call to print from this array is then added, using the current array position counter value named $_PTM_POS, to the command set. Any text that is not within a PTM tag is simply added to the @_PTM array and a request to print from @_PTM at the specified $_PTM_POS counter position is added to the command set.

When all parsing has been completed the command set is run using the eval statement.

Because none of the statements in the requested *.ptm documents are run until the command set has been completed, there is no risk of interfering with the command set's creation by changing global variables within the PTM code. However, during evaluation of the command set, all variables are still accessable and can be changed, at which point code flow could be interrupted by changing these global variables. This is rarely a desired effect, but has been left open so that it may be used at the discretion of the developer.
This Site's PTM Source Code
Hey, this is supposed to be an open source language, right? Right! That even includes this website. Take a look at how we wrote this page if you're having any trouble getting started with PTM. We have included the source to this page using PTM's NOHTML tag (available as of Version 0.3 Alpha via the asterisk [*] symbol) which replaces a file's HTML characters with their ordinal macros before displaying it. We simply dropped the NOHTML file import into a textarea and voila! Search the file for "$_SCRIPT" (no quotes) to see the import. It's nice to be able to import a file into itself -- just remember not to try this with a TEMPLATE tag or you'll likely throw yourself into an infinite loop if your server doesn't have precautions set up against it.

You'll notice we've stored function code for this page in the "ptm.pt_" file. As we are likely to reuse them on other pages there is no reason to have to duplicate them again.

We have named the included file(s) with a ".pt_" file extension and chmod'ed them for public access so you can manually surf to them in your browser and take a look at their source as well. The ".pt_" extension keeps them from being parsed as PTM scripts when loaded individually. So, for example, to see the source of "ptm.pt_", click here: Enjoy =)

Thanks to the Testers
We would like to thank those of you who have helped in the early phases of PTM development and testing. Everything is coming along according to schedule so far, if you can call it a schedule (lol). We're still looking for testers, of course. Anyone that's interested in the project is welcome to download the PPA (PTM Parser Application) and get started right away -- any feedback (preferably through the forums) would be much appreciated.

So who is this "we" I speak of? You, me, the currently active testers, and everyone else that is taking an interest in the PTM project. Though few others ever touch the code currently, my fingers can only jump across the keys as fast as your suggestions can motivate them -- though they are jumping pretty quickly these days =)
Home    SVN    Downloads    Documentation    Forum    Contact