NAME

Template::EmbeddedPerl::Utils - Utility functions for Template::EmbeddedPerl

DESCRIPTION

This module provides utility functions for Template::EmbeddedPerl. It is not intended to be used directly.

EXPORTS

normalize_linefeeds

my $normalized = normalize_linefeeds($template);

Normalize the line endings to \n from mac and windows format.

uri_escape

my $escaped = uri_escape($string);

Escape the uri string.

escape_javascript

my $escaped = escape_javascript($javascript);

Escape the javascript string. This basically takes a string and escapes it so that it can be embedded in a JavaScript string. So it escapes single quotes, backticks, and dollar signs and that sort of this. It is not guaranteed to protect against all forms of XSS attacks. If you are embedding user input in a JavaScript string, you should be sure to have cleaned that first probably using HTML or URI escaping, or running the string through a JavaScript sanitizer to remove any potentially harmful code.

generate_error_message

my $error_message = generate_error_message($msg, $template, $source);

Generate an error message.

SEE ALSO

Template::EmbeddedPerl

AUTHOR

See Template::EmbeddedPerl

COPYRIGHT & LICENSE

See Template::EmbeddedPerl