Tags::Utils - Utils module for Tags.
use Tags::Utils qw(encode_newline encode_attr_entities encode_char_entities); my $string_with_encoded_newline = encode_newline("foo\nbar"); my $string_with_encoded_attr_entities = encode_attr_entities('<data & "data"'); my $string_with_encoded_char_entities = encode_char_entities('<data & data');
encode_newline($string)
Encode newline to '\n' string.
encode_attr_entities($data_r)
Decode all '&..;' strings. Encode '<', '&' and '"' entities to '&..;' string. $data_r can be: - Scalar. Returns encoded scalar. - Scalar reference. Returns undef. - Array reference of scalars. Returns undef.
encode_char_entities($data_r)
Decode all '&..;' strings. Encode '<', '&' and 'non-break space' entities to '&..;' string. $data_r can be: - Scalar. Returns encoded scalar. - Scalar reference. Returns undef. - Array reference of scalars. Returns undef.
encode_attr_entities(): Reference '%s' doesn't supported. encode_char_entities(): Reference '%s' doesn't supported.
use strict; use warnings; use Tags::Utils qw(encode_newline); # Input text. my $text = <<'END'; foo bar END # Encode newlines. my $out = encode_newline($text); # Print out. print $out."\n"; # Output: # foo\nbar\n
use strict; use warnings; use Dumpvalue; use Tags::Utils qw(encode_attr_entities); # Input data. my @data = ('&', '<', '"'); # Encode. encode_attr_entities(\@data); # Dump out. my $dump = Dumpvalue->new; $dump->dumpValues(\@data); # Output: # 0 ARRAY(0x8b8f428) # 0 '&' # 1 '<' # 2 '"'
Error::Pure, HTML::Entities, Readonly.
Install the Tags modules.
https://github.com/michal-josef-spacek/Tags
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz/
© 2005-2023 Michal Josef Špaček
BSD 2-Clause License
0.14
To install Tags, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tags
CPAN shell
perl -MCPAN -e shell install Tags
For more information on module installation, please visit the detailed CPAN module installation guide.