1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
String-Interpolate-Named - Interpolated named arguments in string
String::Interpolate::Named provides a single function, interpolate,
that takes a string and substitutes named variables by target texts.
Example:
use String::Interpolate::Named;
my $ctl = { args => { fn => "Johann", ln => "Bach" } };
say interpolate( $ctl, "The famous %{fn} %{ln}." );
# Result = "The famous Johann Bach"
Other features are selecting true/false texts:
"The task is %{done|ready|unfinished}."
Testing specific values:
"%{instrument=piano|Play this with elbows}"
Selecting one out of a list of values:
"First customer is %{customer.1}"
SUPPORT AND DOCUMENTATION
Development of this module takes place on GitHub:
https://github.com/sciurius/perl-String-Interpolate-Named.
You can find documentation for this module with the perldoc command.
perldoc String::Interpolate::Named
Please report any bugs or feature requests using the issue tracker on
GitHub.
COPYRIGHT AND LICENCE
Copyright (C) 2018,2019 Johan Vromans
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
|