Sam Graham > Template-Sandbox-1.04_01 > Template::Sandbox::StringFunctions

Download:
Template-Sandbox-1.04_01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.04_01   Source  

NAME ^

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

VERSION ^

version 1.04_01

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() 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 ^

:all

Exports all defined template functions in this library.

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:

AUTHOR ^

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

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2005-2010 by Sam Graham <libtemplate-sandbox-perl BLAHBLAH illusori.co.uk>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: