From:                   michael higgins <[EMAIL PROTECTED]>
>  > Gustavo H. Maultasch writes:
>  >  >
>  >  > I´m trying to use template::rtf to generate rtf files,
>  >  > but i´m getting an error for some time.....
>  >  >
>  >  > After calling the 'execute.pl' script from 'system'
>  >  > command, i get the following error:
>  >  > Undefined subroutine &Template::RTF::Process called at
>  >  > C:\testes\execute.pl line
>  >  >  46.
>  >  >
>  >  > can anyone help me ?
>
> I've tried to use template::RTF. I was also unsuccessful at first
> pass.
>
> This is not an academic issue, as it were, 'cause I'm about to blow a
> blood vessel over mailmerges in MS Word.
>
> So, yeah, I'd like to get that going myself.
>
> I may simply opt for another option, like HTML files. I *have* been
> able to use RTF::Writer, but, template::RTF looks cool.

Thanks :-)

> Well, that's TWO folks that are interested...;-)

OK. I'll start cleaning the mess over the weekend.

> 1.) split the module I had (no idea why, but it is this way i must've
> gottent it... 1 file, 2 modules) into 2 files.
>
> One, is the 'package Template::RTF' section. I saved as RTF.pm in the
> lib/template folder.
>
> 2.)
> The rest I saved as RTF.pm in the lib folder.

The Template::RTF is the actuall template processor
(using Template::RTF::Func and Template::RTF::Syntax internaly),
while RTF.pm contains some more widely useable functions like
escaping text for inclusion in RTF, removing RTF codes from text and
so forth. Since it contains even stuff that IS Template::RTF specific
It should have been named Template::RTF::Utils.

> I made 2 changes:
>       ||||||| add this 'Template::
> use Template::RTF qw(asRTF asPLAIN setRTF setPLAIN toRTF); #mike
> #use strict;
> use Interpolation
>   'asRTF' => \&asRTF,
>   'asPLAIN' => \&asPLAIN,
>   'if:$$->$' => sub{$_[1] if $_[0]},
>   'esc' => \&esc,
>   'ifdebug' => \&ifdebug;
>
> commented this out, since I can't find the mod anywhere ;-) :
>
> #use Interpolation::Scalar #mike

Both Interpolation.pm and Interpolation::Scalar.pm is included in the
.zip file.
If you unpack the ZIP preserving the directory paths you will get

        lib\
        TemplateRTF\
        read.me
        RTF.pm.html
        RTF.pm.txt
in the root. Those two plus Enurl, Deurl and Cwd2script are under the
lib\. Instead of the Interpolation.pm included in the ZIP it would be
better to use the version that's on CPAN or my page (version 0.68),
instead of Deurl.pm you should use CGI::Deurl.pm and instead of
Enurl.pm you should use CGI::Enurl.pm (not sure this one is actually
being used). All those are on CPAN and may be installed via PPM.

The Interpolation::Scalar is probably nowhere else to be found so use
the version from the ZIP for now. I'll move the functionality to
Interpolation.pm and

use Interpolation::Scalar
        'Cmdbrace' => sub{
                if ($Template::RTF::cmdbrace) {
                        qq{print "$Template::RTF::cmdbrace"; #cmdbrace\n}
                } else {
                        ''
                }
        };

in Template::RTF::Func.pm will become

use Interpolation::Scalar
        'Cmdbrace:->$' => sub{
                if ($Template::RTF::cmdbrace) {
                        qq{print "$Template::RTF::cmdbrace"; #cmdbrace\n}
                } else {
                        ''
                }
        };

for now try to add
        use lib 'path\to\the\Template_RTF-0.03\lib';
on top of the scripts.

Jenda

===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to