Here::Template - heredoc templates
use Here::Template; print <<'TMPL'; Hello, my pid is <?= $$ ?> Let's count to 10: <? for (1..10) { ?>$_ <? } ?> TMPL
Simple Filter::Util::Call based implementation of heredoc templates.
To enable templates in some heredoc use quoted heredoc mark that contains TMPL. Output is added to the buffer $here. You can append data there as well:
$here
print <<'TMPL'; Hello, my pid is <?= $$ ?> Let's count to 10: <? for (1..10) { $here.= "$_" } ?> TMPL
This module doesn't export anything by default.
Special argument relaxed can be used to disable strict and warnings inside templates. E.g.:
use strict; use warnings; use Here::Template 'relaxed'; print <<'TMPL'; Let's count to 10: <? for $k (1..10) { $here .= "$k "; } ?> TMPL
Alexandr Gomoliako <zzz@zzz.org.ua>
Copyright 2011-2012 Alexandr Gomoliako. All rights reserved.
This module is free software. It may be used, redistributed and/or modified under the same terms as perl itself.
To install Here::Template, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Here::Template
CPAN shell
perl -MCPAN -e shell install Here::Template
For more information on module installation, please visit the detailed CPAN module installation guide.