Data::Phrasebook::Plain - The Simple Phrasebook Model.


NAME

Data::Phrasebook::Plain - The Simple Phrasebook Model.


SYNOPSIS

    use Data::Phrasebook;
    my $q = Data::Phrasebook->new(
        class  => 'Plain',
        loader => 'Text',
        file   => 'phrases.txt',
    );
    my $r = Data::Phrasebook->new( file => 'phrases.txt' );
    # simple keyword to phrase mapping
    my $phrase = $q->fetch($keyword);
    # keyword to phrase mapping with parameters
    $q->delimiters( qr{ \[% \s* (\w+) \s* %\] }x );
    my $phrase = $q->fetch($keyword,{this => 'that'});


DESCRIPTION

This module is the fallback or default phrasebook class. It doesn't do much except act as a very simple templating facility.


METHODS

fetch

Retrieves the specified template and substitutes any keywords for values.

Thus, given:

    hello=Hello [% where %]!

And code:

    my $text = $q->fetch( 'hello', {
        where => 'world'
    } );

Return value is:

    Hello world!

The delimiters are deliberately taken from the Template manpage Toolkit.


SEE ALSO

the Data::Phrasebook manpage, the Data::Phrasebook::Generic manpage.


SUPPORT

Please see the README file.


AUTHOR

  Original author: Iain Campbell Truskett (16.07.1979 - 29.12.2003)
  Maintainer: Barbie <barbie@cpan.org> since January 2004.
  for Miss Barbell Productions <http://www.missbarbell.co.uk>;.


COPYRIGHT AND LICENSE

  Copyright (C) 2003 Iain Truskett.
  Copyright (C) 2004-2007 Barbie for Miss Barbell Productions.
  This library is free software; you can redistribute it and/or modify
  it under the same terms as Perl itself.

The full text of the licenses can be found in the Artistic and COPYING files included with this module, or in the perlartistic manpage and the perlgpl manpage in Perl 5.8.1 or later.