From: Matt S Trout Date: Mon, 13 Aug 2012 20:21:18 +0000 (+0000) Subject: documentationify X-Git-Tag: v1.000000~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d86bdf828539c046cbc09d5073897bf24862c93d;p=scpubgit%2FHTML-String.git documentationify --- diff --git a/lib/HTML/String.pm b/lib/HTML/String.pm index 033be4e..a320a69 100644 --- a/lib/HTML/String.pm +++ b/lib/HTML/String.pm @@ -11,3 +11,145 @@ sub html { } 1; + +__END__ + +=head1 NAME + +HTML::String - mark strings as HTML to get auto-escaping + +=head1 SYNOPSIS + + use HTML::String; + + my $not_html = 'Hello, Bob & Jake'; + + my $html = html('

').$not_html.html('

'); + + print html($html); #

Hello, Bob " Jake

+ +or, alternatively, + + use HTML::String::Overload; + + my $not_html = 'Hello, Bob & Jake'; + + my $html = do { + use HTML::String::Overload; + "

${not_html}

"; + } + + print html($html); #

Hello, Bob " Jake

+ +(but see the L documentation for details and caveats). + +See also L for L