HTML::Entities::Recursive - Encode / decode strings of complex data structure with HTML entities recursively
use HTML::Entities::Recursive; my $recursive = HTML::Entities::Recursive->new; my $foo = { text => '<div></div>', }; my $bar = $recursive->encode_numeric($foo); print $bar->{text}; # prints '<div></div>'
HTML::Entities::Recursive provides API to encode / decode strings of complex data structure with HTML entities recursively.
To avoid conflicting with HTML::Entities' functions, HTML::Entities::Recursive is written in OO-style. There is no function to be exported.
To proxy content provider's API, we sometimes want to bulk decode and encode complex data structure that contains escaped strings with untrustworthy way. (yes, response from Twitter API :)
HTML::Entities::Recursive helps you to make output safe with ease.
new() takes no argument.
new()
HTML::Entities refers to $unsafe_chars.
$unsafe_chars
Methods correspond to HTML::Entities' functions but the first argument can be hashref, arrayref or scalarref.
Internally, all corresponding functions are called in array context. So you cannot use those methods in void context.
That is,
Use methods in scalar or array context.
Methods do not modify original structure.
punytan <punytan@gmail.com>
HTML::Entities
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install HTML::Entities::Recursive, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Entities::Recursive
CPAN shell
perl -MCPAN -e shell install HTML::Entities::Recursive
For more information on module installation, please visit the detailed CPAN module installation guide.