X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FHTML%2FString.pm;h=a7bb28a343d525b9486524e305bb6134828f530a;hb=c82dc8d3a3a6c6afd7f8eee2bba39f9063a01c3e;hp=033be4e9516d40248dc21c17549c3eb83a453972;hpb=e1b4b35c28896558b77f9df03dc4fd5561c84ca4;p=scpubgit%2FHTML-String.git diff --git a/lib/HTML/String.pm b/lib/HTML/String.pm index 033be4e..a7bb28a 100644 --- a/lib/HTML/String.pm +++ b/lib/HTML/String.pm @@ -4,6 +4,10 @@ use strictures 1; use HTML::String::Value; use Exporter 'import'; +our $VERSION = '1.000001'; # 1.0.1 + +$VERSION = eval $VERSION; + our @EXPORT = qw(html); sub html { @@ -11,3 +15,158 @@ 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