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.
lc()
uc()
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.
lcfirst()
ucfirst()
substr( string, offset, length )
Behaves like Perl's substr() except all three arguments are mandatory.
substr()
length( string )
In case you don't like using string.__size__ or size( string ), you can use the "more Perlish" length( string ).
string.__size__
size( 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'".
string
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.
Template::Sandbox, Template::Sandbox::Library
You can find documentation for this module with the perldoc command.
perldoc Template::Sandbox::StringFunctions
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Template-Sandbox
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Template-Sandbox
CPAN Ratings
http://cpanratings.perl.org/d/Template-Sandbox
Search CPAN
http://search.cpan.org/dist/Template-Sandbox
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.
To install Template::Sandbox, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Sandbox
CPAN shell
perl -MCPAN -e shell install Template::Sandbox
For more information on module installation, please visit the detailed CPAN module installation guide.