Tags::Element - Element utilities for 'Tags'.
use Tags::Element qw(element); my @tags = element($element, @data);
element($element, @data)
my @tags = element($element, @data);
Common element helper for writing Tags code.
Returns array of element in Tags format.
use strict; use warnings; use Data::Printer; use Tags::Element qw(element); # Get example element. my @tags = element('div', { 'id' => 'foo', 'class' => 'bar', }, 'Foo', 'Bar'); # Dump to stdout. p @tags; # Output. # [ # [0] [ # [0] "b", # [1] "div" # ], # [1] [ # [0] "a", # [1] "class", # [2] "bar" # ], # [2] [ # [0] "a", # [1] "id", # [2] "foo" # ], # [3] [ # [0] "d", # [1] "Foo" # ], # [4] [ # [0] "d", # [1] "Bar" # ], # [5] [ # [0] "e", # [1] "div" # ] # ]
use strict; use warnings; use Tags::Element qw(element); use Tags::Output::Raw; # Get example element. my @tags = element('div', { 'id' => 'foo', 'class' => 'bar', }, 'Foo', 'Bar'); # Serialize by Tags. my $tags = Tags::Output::Raw->new; $tags->put(@tags); print $tags->flush."\n"; # Output. # <div class="bar" id="foo">FooBar</div>
Exporter, Readonly.
Structure oriented SGML/XML/HTML/etc. elements manipulation.
Install the Tags modules.
Michal Josef Špaček skim@cpan.org
© 2011-2022 Michal Josef Špaček
BSD 2-Clause License
0.04
To install Tags::Element, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tags::Element
CPAN shell
perl -MCPAN -e shell install Tags::Element
For more information on module installation, please visit the detailed CPAN module installation guide.