Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.653.872 Times

Template::Manual::Directives 2.19

  Date Added: November 05, 2010  |  Visits: 757

Template::Manual::Directives

Report Broken Link
Printer Friendly Version


Product Homepage
Download (86 downloads)



Template::Manual::Directives is a Perl module that contains template directives. Accessing and Updating Template Variables GET The GET directive retrieves and outputs the value of the named variable. [% GET foo %] The GET keyword is optional. A variable can be specified in a directive tag by itself. [% foo %] The variable can have an unlimited number of elements, each separated by a dot .. Each element can have arguments specified within parentheses. [% foo %] [% bar.baz %] [% biz.baz(10) %] ...etc... See Template::Manual::Variables for a full discussion on template variables. You can also specify expressions using the logical (and, or, not, ?:) and mathematic operators (+ - * / % mod div). [% template.title or default.title %] [% score * 100 %] [% order.nitems ? checkout(order.total) : no items %] The div operator returns the integer result of division. Both % and mod return the modulus (i.e. remainder) of division. mod is provided as an alias for % for backwards compatibility with version 1. [% 15 / 6 %] # 2.5 [% 15 div 6 %] # 2 [% 15 mod 6 %] # 3 CALL The CALL directive is similar to GET in evaluating the variable named, but doesnt print the result returned. This can be useful when a variable is bound to a sub-routine or object method which you want to call but arent interested in the value returned. [% CALL dbi.disconnect %] [% CALL inc_page_counter(page_count) %] SET The SET directive allows you to assign new values to existing variables or create new temporary variables. [% SET title = Hello World %] The SET keyword is also optional. [% title = Hello World %] Variables may be assigned the values of other variables, unquoted numbers (digits), literal text (single quotes) or quoted text ("double quotes"). In the latter case, any variable references within the text will be interpolated when the string is evaluated. Variables should be prefixed by $, using curly braces to explicitly scope the variable name where necessary. [% foo = Foo %] # literal value Foo [% bar = foo %] # value of variable foo [% cost = $100 %] # literal value $100 [% item = "$bar: ${cost}.00" %] # value "Foo: $100.00" Multiple variables may be assigned in the same directive and are evaluated in the order specified. Thus, the above could have been written: [% foo = Foo bar = foo cost = $100 item = "$bar: ${cost}.00" %] Simple expressions can also be used, as per GET. [% ten = 10 twenty = 20 thirty = twenty + ten forty = 2 * twenty fifty = 100 div 2 six = twenty mod 7 %] You can concatenate strings together using the _ operator. In Perl 5, the . is used for string concatenation, but in Perl 6, as in the Template Toolkit, the . will be used as the method calling operator and _ will be used for string concatenation. Note that the operator must be specified with surrounding whitespace which, as Larry says, is construed as a feature: [% copyright = (C) Copyright _ year _ _ author %] You can, of course, achieve a similar effect with double quoted string interpolation. [% copyright = "(C) Copyright $year $author" %] DEFAULT The DEFAULT directive is similar to SET but only updates variables that are currently undefined or have no "true" value (in the Perl sense). [% DEFAULT name = John Doe id = jdoe %] This can be particularly useful in common template components to ensure that some sensible default are provided for otherwise undefined variables. [% DEFAULT title = Hello World bgcol = #ffffff %] < html> < head> < title>[% title %] < /head> < body bgcolor="[% bgcol %]">.

Requirements: No special requirements
Platforms: Linux
Keyword: Call Default Foo Get Libraries Perl Perl Module Programming Set Template Templatemanualdirectives Variable Variables
Users rating: 0/10

License: Freeware Size: 778.24 KB
USER REVIEWS
More Reviews or Write Review


TEMPLATE::MANUAL::DIRECTIVES RELATED
Libraries  -  PLJava 0.04
PLJava is Perl module that will embed Perl into Java. USAGE import perl5.Perl ; import perl5.SV ; public class test { public static void main(String argv[]) { Perl.eval("print qq`Hello World!n` ;") ; /////////////////// SV foo =...
163.84 KB  
Libraries  -  Filter::decrypt 1.33
Filter::decrypt Perl module contains a template for a decrypt source filter. SYNOPSIS use Filter::decrypt ; This is a sample decrypting source filter. Although this is a fully functional source filter and it does implement a very simple...
40.96 KB  
Libraries  -  Variable::Alias 0.01
Variable::Alias is a Perl module created to alias any variable to any other variable. SYNOPSIS use Variable::Alias alias; my $src; my $a; our $b; my @c; our @d; alias $src => $a; alias $a => $b; alias $b => $c[0]; alias @c => @d;...
3.07 KB  
Libraries  -  Env::Path 0.18
Env::Path is a Perl module with advanced operations on path variables. SYNOPSIS use Env::Path; # basic usage my $manpath = Env::Path->MANPATH; $manpath->Append(/opt/samba/man); for ($manpath->List) { print $_, "n" }; # similar to above...
10.24 KB  
Libraries  -  HCKit::Template 0.02
HCKit::Template is a Perl module with a template system for HTML construction. This module constructs an HTML page from a template. The conversion proceeds with the help of rewrite rules and data sources. Rewrite rules can be specified in the...
11.26 KB  
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  vars::global 0.0.1
vars::global is a Perl module that tries to make global variables a little safer. SYNOPSIS # In the place/package where we want to create globals use vars::global create => qw( $foo @bar %baz ); # Add some more global symbols...
7.17 KB  
Libraries  -  perlrpcgen 0.71
perlrpcgen is a Perl module that can generate Perl interfaces from ONC RPC interface definitions. SYNOPSIS perlrpcgen [--makefile] [--all] [--client] [--server] [--data] [--constants] [--module module] [--typemap typemap] [--fork] [--perl...
37.89 KB  
Libraries  -  Tuxedo 2.08
Tuxedo is a Perl extension module for Tuxedo. This module provides the following functionality... C style interface The Tuxedo perl module gives you access to almost all of the tuxedo 8.1 apis from perl. In most cases you can take the C API...
33.79 KB  
Libraries  -  Wx::Perl::Packager 0.07
Wx::Perl::Packager provides a module to assist packaging Wx based applications with PAR, ActiveState PerlApp / PDK and Perl A module to assist packaging Wx based applications with PAR, ActiveState PerlApp / PDK and Perl2Exe. All that is needed...
12.29 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.11.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
2.73 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB