| Template-Sandbox documentation | view source | Contained in the Template-Sandbox distribution. |
Template::Sandbox::StringFunctions - Basic string functions library for Template::Sandbox.
use Template::Sandbox::StringFunctions qw/:all/;
# or:
use Template::Sandbox::StringFunctions;
my $template = Template::Sandbox->new(
library => [ Template::Sandbox::StringFunctions => qw/ucfirst uc lc/ ],
);
Library of basic string manipulation functions for easy import into a Template::Sandbox template.
lc( string )uc( string )Provides access to the lc() and uc() Perl functions.
lcfirst( string | array )ucfirst( string | array )Provides access to the lcfirst() and ucfirst() functions in Perl,
with the added feature that they can operate over an array of strings
to set each in turn.
substr( string, offset, length )Behaves like Perl's substr() except all three arguments are mandatory.
length( string )In case you don't like using string.__size__ or size( string ), you
can use the "more Perlish" length( string ).
possessive( string )Turns the noun string into a possessive noun as per English's grammar,
ie: "Duncan" becomes "Duncan's" but "James" becomes "James'".
Exports all defined template functions in this library.
There's not really a great many functions in here, the module could be regarded as largely superfluous since you could easily recreate it yourself if you needed it. However it provides a useful example of how to write your own library of template functions.
You can find documentation for this module with the perldoc command.
perldoc Template::Sandbox::StringFunctions
You can also look for information at:
Original author: Sam Graham <libtemplate-sandbox-perl BLAHBLAH illusori.co.uk>
Last author: $Author: illusori $
Copyright 2005-2010 Sam Graham, all rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Template-Sandbox documentation | view source | Contained in the Template-Sandbox distribution. |