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

I am trying to build an .exe out of a (ActivePerl 5.8.822) Perl program that uses Template Toolkit (2.20). The most successful by far has been with a trial Perl2Exe from IndigoStar, but this tool fails to load Template Toolkit.

Has anyone successfully used Perl2Exe with the Template Toolkit? What special magic is required?

I have pasted a much simplified session below. Thank you,
John Elion

C:\p2xtest>type x.pl use strict; use Template; # needed for perl2exe use Template::Base; use Template::Context; use Template::Plugins; use Template::Filters; my $tpl = Template->new() or die (" Can't init template "); print "OK\n"; C:\p2xtest>x.pl OK C:\p2xtest>\p2x\perl2exe x.pl <headers removed> Converting 'x.pl' to x.exe Warning: Can't locate VMS/Stdio.pm at C:\Perl\lib\File\Temp.pm line 145 @INC = C:\Perl\site\lib, C:\Perl\lib, . Warning: Can't locate Apache/Util.pm at C:\Perl\site\lib\Template\Filters.pm line 387 @INC = C:\Perl\site\lib, C:\Perl\lib, . C:\p2xtest>x.exe Can't init template at C:\p2xtest\x.exe line 10.

Replies are listed 'Best First'.
Re: Perl2Exe with Template Toolkit
by jand (Friar) on Jul 18, 2009 at 10:13 UTC
    I have no idea about Perl2Exe, but your sample worked without problems with PerlApp 8.0.1 from the ActiveState Perl Dev Kit (even without the "needed for perl2exe" hints).

    Disclaimer: I work for ActiveState and wote large parts of PerlApp. Feel free to let me know if check out PerlApp and it has problems with your Template::Toolkit code.

      Beautiful. I downloaded the Perl Dev Kit and "perlapp" worked "out of the box". It even included the Tk modules which have since accreted into our scripts.

      Thanks very much,
      JKE