NAME

XML::Template::Subroutine - The default XML::Template subroutine handling module.

SYNOPSIS

XML::Template supports calling subroutines on variables (e.g., ${varname}.subname (params)). You can associate a Perl module with a subroutine in the XML::Template configuration file (see XML::Template::Config. Whenever the subroutine is encountered, the module will be loaded and the method with the same name as the XML::Template subroutine will be called with the following parameters: the name of the variable the subroutine is being called on, the variable's value, an array of additional parameters to the XML::Template subroutine. If no Perl module is associated with a subroutine, the subroutine is called from this module. Tpically, these subroutines are not called directly but from the method subroutine in XML::Template::Process.

XML::Template SUBROUTINES

defined

Returns true if the variable is defined.

set_date_vars

This subroutine is used to set various date related variables in the current variable context. It should be called on a variable whose value is in the MySQL datetime format. It take an addition parameter, prefix, which is prepended to each date variable set. Variables are set for the year, month, day, hour, minute, and second.

format_date

This subroutine returns a date in the format specified by the additional parameter format. It currently only supports variable values in the MySQL datetime format.

replace

This subroutine replaces a substring of the value identified by a regular expression with another string. The first additional parameter is the regular expression, the second is the replacement string.

encrypt

This subroutine encrypts the value and returns the result.

AUTHOR

Jonathan Waxman <jowaxman@bbl.med.upenn.edu>

COPYRIGHT

Copyright (c) 2002-2003 Jonathan A. Waxman All rights reserved.

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