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

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

Serving Software Downloads in 956 Categories, Downloaded 50.234.091 Times

Template::Manual::Directives 2.19

  Date Added: November 05, 2010  |  Visits: 1.235

Template::Manual::Directives

Report Broken Link
Printer Friendly Version


Product Homepage
Download (111 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  -  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  -  Video::Info::FOO 0.993
Video::Info::FOO is a Perl module for video information. Video::Info::FOO - what is it useful for? an example list: -video codec -audio codec -frame height -frame width -frame count and more! SYNOPSIS use Video::Info::FOO; my...
634.88 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Network & Internet  -  MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an...
16.38 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  -  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  -  Text::Macro 0.07
Text::Macro Perl module is a template facility whos focus is on generating code such as c, java or sql. While generating perl code is also possible, there is a potential conflict between the control-symbol and the perl comment symbol. Perl is...
12.29 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
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  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.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...
3.88 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