Template::Sandbox::StringFunctions - Basic string functions library for Template::Sandbox.


Template-Sandbox documentation  | view source Contained in the Template-Sandbox distribution.

Index


NAME

Top

Template::Sandbox::StringFunctions - Basic string functions library for Template::Sandbox.

SYNOPSIS

Top

  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

Top

Library of basic string manipulation functions for easy import into a Template::Sandbox template.

EXPORTABLE TEMPLATE FUNCTIONS

Top

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'".

EXPORTABLE GROUPS

Top

:all

Exports all defined template functions in this library.

KNOWN ISSUES AND BUGS

Top

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

Top

Template::Sandbox, Template::Sandbox::Library

SUPPORT

Top

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

AUTHORS

Top

Original author: Sam Graham <libtemplate-sandbox-perl BLAHBLAH illusori.co.uk>

Last author: $Author: illusori $

COPYRIGHT & LICENSE

Top


Template-Sandbox documentation  | view source Contained in the Template-Sandbox distribution.