Text::MicroTemplate::File(3pm) User Contributed Perl Documentation Text::MicroTemplate::File(3pm)NAME
Text::MicroTemplate::File - a file-based template manager
SYNOPSIS
use Text::MicroTemplate::File;
our $mtf = Text::MicroTemplate::File->new(
include_path => [ $path1, $path2, ... ],
use_cache => 1,
);
# render
$mtf->render_file('template.file', $arg1, $arg2, ...);
DESCRIPTION
Text::MicroTemplate::File is a file-based template manager for Text::MicroTemplate.
PROPERTIES
Text::MicroTemplate provides OO-style interface with following properties.
include_path
include path (default: ['.'])
This accessor is readonly.
use_cache
cache mode (0: no cache (default), 1: cache with update check, 2: cache but do not check updates)
open_layer
layer passed to open (default: ":utf8")
package_name
package under where template files are compiled (default: "main")
METHODS
build_file($file)
Returns a subref that renders given template file.
render_file($file, @args)
Renders the template file with given arguments.
wrapper_file($file, @args)->(sub { template lines })
Wraps given template with wrapper file. Internally the processed template is passed as $_[0] to the wrapper template.
SEE ALSO
Text::MicroTemplate
AUTHOR
Kazuho Oku <kazuhooku gmail.com>
LICENSE
This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10.
perl v5.10.1 2010-09-06 Text::MicroTemplate::File(3pm)
Check Out this Related Man Page
MicroMason::QuickTemplate(3pm) User Contributed Perl Documentation MicroMason::QuickTemplate(3pm)NAME
Text::MicroMason::QuickTemplate - Alternate Syntax like Text::QuickTemplate
SYNOPSIS
Instead of using this class directly, pass its name to be mixed in:
use Text::MicroMason;
my $mason = Text::MicroMason::Base->new( -QuickTemplate );
Use the standard compile and execute methods to parse and evalute templates:
print $mason->compile( text=>$template )->( @%args );
print $mason->execute( text=>$template, @args );
Or use Text::QuickTemplate's calling conventions:
$template = Text::MicroMason->new( -HTMLTemplate, text=>'simple.tmpl' );
print $template->fill( %arguments );
Text::QuickTemplate provides a syntax to embed values into a text template:
Good {{timeofday}}, {{name}}!
DESCRIPTION
This mixin class overrides several methods to allow MicroMason to emulate the template syntax and some of the other features of
Text::QuickTemplate.
This class automatically includes the following other mixins: TemplateDir, HasParams, and StoreOne.
Compatibility with Text::QuickTemplate
This is not a drop-in replacement for Text::QuickTemplate, as the implementation is quite different, but it should be able to process most
existing templates without major changes.
The following features of EmbPerl syntax are supported:
o Curly bracketed tags with parameter names.
o Array of parameters hashes.
o Special $DONTSET variable.
SEE ALSO
The interface being emulated is described in Text::QuickTemplate.
For an overview of this templating framework, see Text::MicroMason.
This is a mixin class intended for use with Text::MicroMason::Base.
For distribution, installation, support, copyright and license information, see Text::MicroMason::Docs::ReadMe.
perl v5.10.1 2007-01-29 MicroMason::QuickTemplate(3pm)
I need to align text from a file that has columns seperated by spaces and commas. Any ideas?
Text is similar to this.
File Name is Test.
05/14/06 13:46:56.575 ,TEST,5,123,1234,123,12345,12,12.2,2.1,4.5,5.23
05/14/06 13:49:58.009 ,TEST,6,456,456.7,45,4.56,453,34,54.3,3.2,6.456 (9 Replies)
Hi,
I have 2 files
File-template
NAME 1
CITY 2
AMOUNT 3
BAL 4
File - data
Anderson,,100,3000
File data always will have single record.
I the above case, if I want to extract value of AMOUNT from file data.
First I'll have to find position of AMOUNT in template and extract... (5 Replies)
Running into a little problem with blank lines.
My file is of this format:
To number each line of the file i would use:
n=1
echo "$FILE" |
while read line
do
echo "$n) $line"
n=`expr $n + 1`
But really, i dont want to number the blank lines.
What i've tried is to use sed... (13 Replies)
Hi,
I have a file like that
No seq Text
269091 123443124 how are slkslks, serial no is 042890000 and pincode is
090001223433454
269091 123443124 how are slkslks, Sr/no is 0428901 and 14 digits are is
... (3 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Write a shell script that gives a passed file the "755" access permissions. The shell script should:
Change... (5 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
Hello all, I have posted here before and really was blown away by the amount of assistance I received. I was able to finish my homework without a problem! But, yet again, our... (6 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
File hello.h
#include <stdio.h>
File main.c
#include "hello.h"
main()
{
printhello();
... (4 Replies)
Given two files:
File1 - source data
abc
def
ghi
File 2 - a template to be edited with data from File 1
This is a line with a @tag@ of some item A
This is a line with a @tag@ of some item B
This is a line with a @tag@ of some item C
What I want to do is substitute @tag@ with a value... (3 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Need to check the disk space and if any portion disk space usage high then write to one file, later will... (5 Replies)
hi,
I am trying to get the FileType using the File command. I have one file, which holds Group separator along with ASCII character.
It's a Text file.
But when I ran the File command the FileType is coming as "data".
It should be "ASCII, Text file".
Is the latest version of File... (6 Replies)
Hi all,
Saying we have two files:
1. A "Reference File" whose content is "Variable Name": "Variable Value"
2. A "Model File" whose content is a model program in which I want to substitute "VariableName" with their respective value to produce a third file "Program File" which would be a... (4 Replies)