The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Petal::Doc::Inline - Petal Inline Syntax

SYNOPSIS

This is an article, not a module.

SUMMARY

This syntax is provided to do simple variable interpolation.

It is quite similar to HTML::Template or the Template Toolkit syntaxes and it is quite easy to turn into Perl code.

NAMESPACE

None.

STATEMENTS

Syntax

$EXPRESSION - or - ${EXPRESSION}.

If ${EXPRESSION} is followed by a space and if EXPRESSION itself has no spaces, then the curly brackets are not needed (although it doesn't hurt to have them).

Otherwise, you need to use ${EXPRESSION}.

In doubt, use ${EXPRESSION}.

To know what EXPRESSION means, see Petal::Syntax::Petales.

Example

  <p>
    Dear ${user/gender}. ${user/last_name},<br /><br />

    Your current account balance is ${user/account/balance}.
    Your saving account is ${user/savings/amount}.

    That's a total of
    ${math/add user/account/balance user/saving/amount}.

    Just to let you know.
  </p>

Advice

Don't use this syntax too much except for very simple cases and rapid prototyping. Use the Petal::Syntax::TAL or the Petal::Syntax::PIs syntaxes instead.

AUTHOR

Copyright 2002 - Jean-Michel Hiver <jhiver@mkdoc.com>

This module is free software and is distributed under the same license as Perl itself.