NAME
Template::Sandbox::StringFunctions - Basic string functions library for Template::Sandbox.
SYNOPSIS
use Template::Sandbox::StringFunctions qw/:all/;
# or:
use Template::Sandbox::StringFunctions;
my $template = Template::Sandbox->new(
library => [ Template::Sandbox::StringFunctions => qw/ucfirst uc lc/ ],
);
DESCRIPTION
Library of basic string manipulation functions for easy import into a Template::Sandbox template.
EXPORTABLE TEMPLATE FUNCTIONS
lc( string )uc( string )-
Provides access to the
lc()anduc()Perl functions. lcfirst( string | array )ucfirst( string | array )-
Provides access to the
lcfirst()anducfirst()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__orsize( string ), you can use the "more Perlish"length( string ). possessive( string )-
Turns the noun
stringinto a possessive noun as per English's grammar, ie: "Duncan" becomes "Duncan's" but "James" becomes "James'".
EXPORTABLE GROUPS
KNOWN ISSUES AND BUGS
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.
SEE ALSO
Template::Sandbox, Template::Sandbox::Library
SUPPORT
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
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
AUTHORS
Original author: Sam Graham <libtemplate-sandbox-perl BLAHBLAH illusori.co.uk>
Last author: $Author: illusori $
COPYRIGHT & LICENSE
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.