nop has asked for the wisdom of the Perl Monks concerning the following question:

Two small questions on TT2: Thanks
nop

Replies are listed 'Best First'.
Re: Two Template Toolkit questions
by lachoy (Parson) on Feb 23, 2002 at 19:27 UTC

    Just like Perl, you can use single or double quotes:

    #!/usr/bin/perl use strict; use Template; my $template = Template->new(); $template->process( \*DATA, { runme => sub { return "<$_[0]->{title}>" } } ); __DATA__ [% runme( title = "don't try this" ) %]

    Produces:

    <don't try this>

    Chris
    M-x auto-bs-mode

Re: Two Template Toolkit questions
by Dog and Pony (Priest) on Feb 23, 2002 at 17:29 UTC
    I admit I haven't used this module, but you have tried 'Don\'t try this'? If you are looking for the HTML escape though, I think it is "&#39;".
    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.
Re: Two Template Toolkit questions
by nop (Hermit) on Feb 23, 2002 at 17:12 UTC
    Well, after scratching my head a bit, I realized the second one is fine. It looked broken (it wasn't) because  c1 was coming from a database field and was right-packed with spaces -- almost 1200 of them.

    Still wondering about my 1st question, tho

    nop