HTML::Template::Compiled::Utils(3pm)

HTML::Template::Compiled::Utils3pm

Utility functions for html::template::compiled

Usage

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

Debugging functions

stack

    $self->stack;

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

md5

 md5($text)

If Digest::MD5 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.

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;

escape_ijson

  my $escaped_js = escape_ijson($raw_js);

JavaScript-escapes the input string except for the apostrophe and returns it, so it can be used within a JSON element.

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 4 times.

  1. 6.0
  2. 7
  3. 8
  4. 9–11
  5. 12–13

From libhtml-template-compiled-perl 1.003-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.