| Mojolicious documentation | view source | Contained in the Mojolicious distribution. |
Mojo::Util - Portable Utility Functions
use Mojo::Util qw/url_escape url_unescape/; my $string = 'test=23'; url_escape $string; url_unescape $string;
Mojo::Util provides portable utility functions for Mojo. Note that this module is EXPERIMENTAL and might change without warning!
Mojo::Util implements the following functions.
b64_decodeb64_decode $string;
Base64 decode in-place.
b64_encodeb64_encode $string;
Base64 encode in-place.
camelizecamelize $string;
Camelize string in-place.
foo_bar -> FooBar
decamelizedecamelize $string;
Decamelize string in-place.
FooBar -> foo_bar
decodedecode 'UTF-8', $octets;
Decode octets in-place.
encodeencode 'UTF-8', $chars;
Encode characters in-place.
get_linemy $line = get_line $chunk;
Extract a whole line from chunk or return undef.
Lines are expected to end with 0x0d 0x0a or 0x0a.
hmac_md5_summy $checksum = hmac_md5_sum $string, $secret;
Generate HMAC-MD5 checksum for string.
hmac_sha1_summy $checksum = hmac_sha1_sum $string, $secret;
Generate HMAC-SHA1 checksum for string.
Note that Perl 5.10 or Digest::SHA are required for SHA1 support.
html_escapehtml_escape $string;
HTML escape string in-place.
html_unescapehtml_unescape $string;
HTML unescape string in-place.
md5_bytesmy $checksum = md5_bytes $string;
Generate binary MD5 checksum.
md5_summy $checksum = md5_sum $string;
Generate MD5 checksum.
punycode_decodepunycode_decode $string;
Punycode decode string in-place, as described in RFC 3492.
punycode_encodepunycode_encode $string;
Punycode encode string in-place, as described in RFC 3492.
quotequote $string;
Quote string in-place.
qp_decodeqp_decode $string;
Quoted Printable decode in-place.
qp_encodeqp_encode $string;
Quoted Printable encode in-place.
sha1_bytesmy $checksum = sha1_bytes $string;
Generate binary SHA1 checksum.
Note that Perl 5.10 or Digest::SHA are required for SHA1 support.
sha1_summy $checksum = sha1_sum $string;
Generate SHA1 checksum.
Note that Perl 5.10 or Digest::SHA are required for SHA1 support.
trimtrim $string;
Trim whitespace characters from both ends of string in-place.
unquoteunquote $string;
Unquote string in-place.
url_escapeurl_escape $string; url_escape $string, 'A-Za-z0-9\-\.\_\~';
URL escape in-place.
url_unescapeurl_unescape $string;
URL unescape in-place.
xml_escapexml_escape $string;
XML escape string in-place, this is a much faster version of html_escape
escaping only the characters &, <, >, " and '.
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
| Mojolicious documentation | view source | Contained in the Mojolicious distribution. |