expand_tabs($str,[$tabwidth])
Receives a string that might contain tabs in it, and replaces those tabs with spaces, each tab with the
number of spaces defined by $tabwidth, or, if $tabwidth was not passed, with 8 spaces.
escape_xml($str)
Receives a string of XML (or (x)HTML) code and converts the characters <>&\' to HTML entities. This is
the method that is invoked when you use [= $expression =] in your templates.
unescape_xml($str)
Receives a string of escaped XML (or (x)HTML) code (for example, a string that was escaped with the
escape_xml() function, and 'unescapes' all HTML entities back to their actual characters.
encode_url($url)
Receives a URL and encodes it by escaping 'non-standard' characters.
decode_url($url)
Does the opposite of encode_url().
checked($val)
Receives a value of some sort, and if it is a true value, returns the string ' checked="checked"' which
can be appended to HTML checkboxes.
selected($val)
Receives a value of some sort, and if it is a true value, returns the string ' selected="selected"' which
can be used in an option in an HTML select box.
disabled($val)
Receives a value of some sort, and if it is a true value, returns the string ' disabled="disabled"' which
can be used in an HTML input.
nl2br($text)
Receives a string of text containing lines delimited by newline characters (\n, or possibly \r\n) and
appends an HTML line break (<br />) to every line (the newline character is left untouched).
text2html($text)
Receives a string of text containing lines delimited by newline characters, and possibly some XML (or
(x)HTML) code, escapes that code with escape_xml() and then appends an HTML line break to every line with
nl2br().
tagattr($name,$expr,[$value])tagattrs(%attrs)new_cycle(@items)
Creates a subroutine reference that can be used for cycling through the items of the @items array. So,
for example, you can:
my $cycle = new_cycle(qw/red green blue/);
print $cycle->(); # prints 'red'
print $cycle->(); # prints 'green'
print $cycle->(); # prints 'blue'
print $cycle->(); # prints 'red' again