![PTM Logo](images/ptm_logo.gif) |
Version 0.5.1 Beta |
|
![](images/spacer.gif) |
![](images/spacer.gif) |
![](images/top_three_reasons.gif) |
![](images/download_button.gif) |
|
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.
|
|
|
|
|
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.
|
|
|
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: http://ptm-ppa.sourceforge.net/ptm.pt_. Enjoy =)
|
|
|
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 =)
|
|
|
|