NAME

Locale::Utils::PlaceholderNamed - Utils to expand named placeholders

$Id: PlaceholderNamed.pm 395 2012-03-20 20:17:19Z steffenw $

$HeadURL: https://perl-gettext-oo.svn.sourceforge.net/svnroot/perl-gettext-oo/Locale-Utils-PlaceholderNamed/trunk/lib/Locale/Utils/PlaceholderNamed.pm $

VERSION

0.004

SYNOPSIS

use Locale::Utils::PlaceholderNamed;

my $obj = Locale::Utils::PlaceholderNamed->new(
    # optional strict switch
    strict => 1,
);

$expanded = $obj->expand_named($text, %args);

DESCRIPTION

Utils to expand named placeholders.

SUBROUTINES/METHODS

method strict

If strict is false: undef will be converted to q{}. If strict is true: no replacement.

$obj->strict(1); # boolean true or false;

method expand_named

Expands strings containing named placeholders like {name}.

$text = 'foo {name} baz';
%args = (
    name => 'bar',
);

$expanded = $obj->expand_named($text, %args);

or

$expanded = $obj->expand_text($text, \%args);

EXAMPLE

Inside of this distribution is a directory named example. Run the *.pl files.

DIAGNOSTICS

none

CONFIGURATION AND ENVIRONMENT

none

DEPENDENCIES

Moo

MooX::StrictConstructor

MooX::Types::MooseLike

namespace::autoclean

syntax

INCOMPATIBILITIES

not known

BUGS AND LIMITATIONS

not known

SEE ALSO

http://en.wikipedia.org/wiki/Gettext

Locale::TextDomain

AUTHOR

Steffen Winkler

LICENSE AND COPYRIGHT

Copyright (c) 2011 - 2013, Steffen Winkler <steffenw at cpan.org>. All rights reserved.

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