HTML::Template::Compiled::Utils - Utility functions for HTML::Template::Compiled


Back to Top


NAME

HTML::Template::Compiled::Utils - Utility functions for HTML::Template::Compiled

Back to Top


SYNOPSIS


 # import log() and stack()
 use HTML::Template::Compiled::Utils qw(:log);
 # import the escapign functions
 use HTML::Template::Compiled::Utils qw(:escape);

Back to Top


DEBUGGING FUNCTIONS

stack

    $self->stack;

For HTML::Template:Compiled developers, prints a stack trace to STDERR.

md5

 md5($text)

If the Digest::MD5 manpage is installed, returns the md5_base64 for $text, otherwise returns the empty string.

log

 $self->log(@msg)

For HTML::Template::Compiled developers, print log from @msg to STDERR.

Back to Top


ESCAPING FUNCTIONS

escape_html

  my $escaped_html = escape_html($raw_html);

HTML-escapes the input string (only &, ", single quotes, < and > and returns it;

escape_html_all

  my $escaped_html = escape_html_all($raw_html);

HTML-escapes the input string (with HTML::Entities) and returns it;

escape_uri

  my $escaped_uri = escape_uri($raw_uri);

URI-escapes the input string and returns it;

escape_js

  my $escaped_js = escape_js($raw_js);

JavaScript-escapes the input string and returns it;

Back to Top

 HTML::Template::Compiled::Utils - Utility functions for HTML::Template::Compiled