Michael Brown > HTML-Native > HTML::Native::Comment

Download:
HTML-Native-1.1.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

HTML::Native::Comment - HTML::Native comment

SYNOPSIS ^

    use HTML::Native::Comment;

    my $comment = HTML::Native::Comment->new ( "This is a comment" );
    print $comment;
    # prints "<!-- This is a comment -->"

DESCRIPTION ^

An HTML::Native::Comment object represents an HTML comment. It can safely be included within an HTML::Native tree without being subject to entity encoding.

METHODS ^

new()

    $comment = HTML::Native::Comment->new ( <text> );

Create a new HTML::Native::Comment object, representing a single HTML comment. For example:

    my $comment = HTML::Native::Comment->new ( "This is a comment" );
    print $comment;
    # prints "<!-- This is a comment -->"

or

    my $elem = HTML::Native->new (
      div =>
      [ h1 => "Welcome" ],
      "Hello world!",
      HTML::Native::Comment->new ( "Hide this" ),
    );
    print $elem;
    # prints "<div><h1>Welcome</h1>Hello world!<!-- Hide this --></div>"
syntax highlighting: