Steven Haryanto > Language-Expr-0.21 > Language::Expr::Compiler::PHP

Download:
Language-Expr-0.21.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  1
View/Report Bugs
Module Version: 0.21   Source  

NAME ^

Language::Expr::Compiler::PHP - Compile Language::Expr expression to PHP

VERSION ^

version 0.21

SYNOPSIS ^

 use Language::Expr::Compiler::PHP;
 my $phpc = Language::Expr::Compiler::PHP->new;
 print $phpc->php('[1, 2, 3])'); # prints: array(1, 2, 3)

 # map Expr function to PHP function
 $phpc->func_mapping->{uc} = 'strtoupper';
 print $phpc->php(q{uc("party like it's ") . ceil(1998.9)}); # prints: strtoupper("party like it's " + ceil(1998.9)

DESCRIPTION ^

Compiles Language::Expr expression to PHP code. Some notes:

METHODS ^

php($expr) => $php_code

Convert Language::Expr expression into PHP code. Dies if there is syntax error in expression.

AUTHOR ^

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2013 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: