CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Advanced:
PTM Inline Perl/HTML Hybrid Language - Development assistance


New User

Sep 28, 2005, 6:16 PM

Post #1 of 3 (1653 views)
PTM Inline Perl/HTML Hybrid Language - Development assistance Can't Post

In a way this is a request for help and in another it's an introduction.

For those of you interested in assisting in the development of new languages, we're looking for some Perl developers to jump PTM through the proverbial hoops.

PTM is a new Perl/HTML hybrid language, similar to PHP in tag syntax, currently under development that allows for Perl and HTML to be streamlined together in *.ptm files which are parsed server-side before being sent out to your web users. It's believed to be fully stable as of version 0.3 Alpha, but it'd be nice to have a couple more advanced Perl users give it a trial run and see how quickly they can crash it Smile Any bugs notation would be appreciated in this thread or in the PTM forums and anyone that's interested in taking part in the project, be it through direct development or simply throwing in a few good ideas is welcome to drop me a line via the forums or by e-mail at

For those of you that aren't interested in actually helping, but are looking for a nice PHP alternative, give PTM a try. So far only a few sites have been built with official releases, but then again it's only been officially released for a week Tongue There's apparently a PTM fan site in the works too, lol (that was fast).

Anyway, the PTM project info can be found at and any feedback's appreciated. If you simply MUST e-mail me, make sure to mention PTM in the subject or it's likely to get deleted.

Michael L. Spencer
PTM Project Founder

Thaumaturge / Moderator

Sep 29, 2005, 2:09 AM

Post #2 of 3 (1646 views)
Re: [xmxspencer] PTM Inline Perl/HTML Hybrid Language - Development assistance [In reply to] Can't Post

It seems to be some kind of rite of passage that all Perl programmers must write their own templating system at some time. Thankfully most of them don't go as far as releasing it publically.

So I was just wondering why someone would want to use your new system instead of one of the bazillion or so already existing solutions.

I know I'm slightly biased. The Template Toolkit has always done what I want.

Dave Cross, Perl Hacker, Trainer and Writer
Get more help at Perl Monks

New User

Sep 29, 2005, 4:11 AM

Post #3 of 3 (1644 views)
Re: [davorg] PTM Inline Perl/HTML Hybrid Language - Development assistance [In reply to] Can't Post

After looking through the forums, I thought you might reply to this post, davorg Smile

I completely agree. The Template Toolkit has worked fine for me in the past as well. However, it practically requires your average user to learn a new language all together and does not use straight Perl within its tags. Additionally it requires developers to look over a large amount of documentation before it can be used effectively.

Another commonly posed PTM alternative is InlinePerlPages (, which you also probably know of. It's functional, but somewhat akward in syntax at best.

The initial draw of PTM is the same as that of PHP. Simple code drop-ins where you want them with HTML-like tag syntax. To make life easier for PHP users I also decided, as of the first release, to implement basic-functionality ports of the _GET, _POST, and _SERVER variables from PHP.

Additionally, the $_URL, $_PATH, $_BASE, and $_SCRIPT vars come in handy for drawing up link structures quickly, and allow for portablility between servers, or just between directories without having to modify any of the script files. And, as the PPA (ptm.cgi) automatically adjusts its working directory to that of the requested script, all file handling operations are implemented from the calling directory so developers don't need to worry about the location of the actual script when loading files (important if installed directly to Apache, where the developers may not know the PPA's install path on host servers).

Next, assuming you've looked over the project page, you know that PTM is only at release version 0.3 Alpha. It is completely stable, and full Perl implementation is available to developers at this point. However, there are many more intended additions that simply haven't made it into the language yet. The next intended fix is to allow HTTP header modification, and after that I will begin wrapping the DBI-mysql module functionality to give PTM a similar ease of use with MySQL databases as PHP has, which is one of the contributing factors to its success to date.

Another advantage is that PTM is written entirely in Perl. One view on this could be that this may be slightly slower than a C implementation, for example. But this allows Perl developers to fully customize the language itself to suit their needs, on a per-project basis if necessary. They can add or remove tag types, redefine tag opening and closing characters (e.g. if you prefer [%, go for it), and create custom global variables. Because PTM is written in the very language it's implementing, it allows Perl developers to develop not only with the language, but on the language itself.

Of course your biased. ALL experienced developers are biased Tongue I started the PTM project because I too am biased -- but in a much more general sense. I am biased on the side of Perl over PHP and ASP. Why? because it's faster for what most of my clients require. However, Perl is not the right languge for all jobs, and I sometimes find myself using PHP instead. PTM allows for a relatively smooth conversion between the two languages, where as something like the Template Toolkit might as well be an alien language to your average PHP developer.

I think that's enough for now... but does it answer your question? Smile

Michael L. Spencer
PTM Project Founder


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives