App::EscapeUtils - Various string escaping/unescaping utilities
This document describes version 0.002 of App::EscapeUtils (from Perl distribution App-EscapeUtils), released on 2019-12-15.
This distributions provides the following command-line utilities:
backslash-escape
backslash-unescape
html-escape
html-unescape
js-escape
js-unescape
perl-dquote-escape
perl-squote-escape
pod-escape
shell-escape
uri-escape
uri-unescape
Usage:
backslash_escape(%args) -> [status, msg, payload, meta]
Escape lines of input using backslash octal sequence (or \r, \n, \t).
This function is not exported.
Arguments ('*' denotes required arguments):
strings* => array[str]
Returns an enveloped result (an array).
First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (payload) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.
Return value: (str)
backslash_unescape(%args) -> [status, msg, payload, meta]
Restore backslash octal sequence (or \r, \n, \t) to original characters in lines of input (in stdin or arguments).
html_escape(%args) -> [status, msg, payload, meta]
HTML-escape lines of input (in stdin or arguments).
html_unescape(%args) -> [status, msg, payload, meta]
HTML-unescape lines of input (in stdin or arguments).
js_escape(%args) -> [status, msg, payload, meta]
Encode lines of input (in standard input or arguments) as JSON strings.
js_unescape(%args) -> [status, msg, payload, meta]
Interpret lines of input (in standard input or arguments) as JSON strings and return the decoded value.
perl_dquote_escape(%args) -> [status, msg, payload, meta]
Encode lines of input (in stdin or arguments) inside Perl double-quoted strings.
perl_squote_escape(%args) -> [status, msg, payload, meta]
Encode lines of input (in stdin or arguments) inside Perl single-quoted strings.
pod_escape(%args) -> [status, msg, payload, meta]
Quote POD special characters in input (in stdin or arguments).
shell_escape(%args) -> [status, msg, payload, meta]
Shell-escape lines of input (in stdin or arguments).
uri_escape(%args) -> [status, msg, payload, meta]
URI-escape lines of input (in standard input or arguments).
uri_unescape(%args) -> [status, msg, payload, meta]
URI-unescape lines of input (in standard input or arguments).
Please visit the project's homepage at https://metacpan.org/release/App-EscapeUtils.
Source repository is at https://github.com/perlancar/perl-App-EscapeUtils.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-EscapeUtils
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
URI::Escape
String::JS
String::Escape
HTML::Entities
String::ShellQuote and ShellQuote::Any::Tiny
String::xcPodQuote
String::PerlQuote
perlancar <perlancar@cpan.org>
This software is copyright (c) 2019, 2017 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::EscapeUtils, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::EscapeUtils
CPAN shell
perl -MCPAN -e shell install App::EscapeUtils
For more information on module installation, please visit the detailed CPAN module installation guide.