HTML-Template-Compiled-Plugin-VBEscape

 view release on metacpan or  search on metacpan

example/02_default_escape.pl  view on Meta::CPAN

#!perl

use strict;
use warnings;

our $VERSION = 0;

use HTML::Template::Compiled;

my $htc = HTML::Template::Compiled->new(
    plugin         => [qw(HTML::Template::Compiled::Plugin::VBEscape)],
    tagstyle       => [qw(-classic -comment +asp)],
    default_escape => 'VB',
    scalarref      => \<<'EOVB');
<script language="VBScript"><!--
    string1 = "<%= attribute%>"
    string2 = "<%= cdata%>"
'--></script>
EOVB
$htc->param(
    attribute => 'foo "bar"',
    cdata     => 'text "with" double quotes',
);
() = print $htc->output();

# $Id$

__END__

Output:

<script language="VBScript"><!--
    string1 = "foo ""bar"""
    string2 = "text ""with"" double quotes"
'--></script>



( run in 3.560 seconds using v1.01-cache-2.11-cpan-9581c071862 )