Stefan Traby > Cac > Cac::ObjectScript

Download:
Cac-1.83.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.83   Source  

NAME ^

Cac::ObjectScript - Source Filter for embedding ObjectScript expressions in Perl

SYNOPSIS ^

 use Cac::ObjectScript;
 my $a = 1;
 $a = <? :a +1:>:
 <:K ^foobar(:a):>
 no Cac::ObjectScript; # disable source filter

DESCRIPTION ^

This module allows you to embed ObjectScript expressions enclosed in "<?" ... ":>" or ObjectScript statements in "<:" ... ":>"

The expressions are not evaluated, they are compiled into ObjectScript functions for everlasting speed.

You can use bind variables using :var notation.

Generated routines are named CPERLxxxxxxxxxxxxxxxxxxxxxxxxx where each x stands for a hexadecimal digit.

This is currently the md5sum (except last 7 digits) over the version of this module and the expression.

Anyway this may change (do not rely on that :), but I gurarantee that I only generate routines named "CPERL*".

If you just want to evaluate a Cache-String (i.e: a non constant expression) use CacEval $string of the Cac package.

You could also the following instead:

 my $eval = "K GeorgeBush"; # this is a political statement :)
 <: @:eval:>

but it doesn't look so fine :) If you got this, you've probably understand that module.

If you insist to write order-loops, try something like this:

 my $a="";
 do {
      $a = <?$order(^rOBJ(:a)):>;
      print "$a\n";
    } while length $a;

EXPORTS ^

 none.

BUGS ^

 Design: This Module creates a routine for every <[:?] ...  :> expression.
         It should create a single routine for each Perl source file.
         (The current design "eats" routine-buffers)
         I'm going to change that but that's not too high on my priority list.
         (Finding a girlfriend is :)

SEE ALSO ^

Cac, Cac::Global, Cac::Routine, Cac::Util, Cac::Bind.

AUTHOR ^

 Stefan Traby <stefan@hello-penguin.com>
 http://hello-penguin.com
syntax highlighting: