After years of threatening, I've finally spun POE::Preprocessor off into a separate project. It just needs a good name before I upload it. The current documentation is at <http://search.cpan.org/~rcaputo/ POE/lib/POE/Preprocessor.pm>.

Executive summary: This source filter (code named Filter::Inline) adds syntax for inline code templates. Definitions look like named- prototyped subs, using the "macro" keyword:

  macro max (one,two) {
    ((one)>(two)?(one):(two))
  }

Invocations look rather template-like:

  print {% max $one, $two %};

At load time, parameters are literally expanded into macro bodies, which are then inserted into your code. The above example is compiled as:

  print (($one)>($two)?($one):($two));

It supports some other syntax, but the macros are the main attraction.

--
Rocco Caputo - [EMAIL PROTECTED]

Reply via email to