Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Installing Template::Toolkit on Windows

by davies (Monsignor)
on Feb 22, 2013 at 13:44 UTC ( [id://1020161]=perlmeditation: print w/replies, xml ) Need Help??

This is needed by BugZilla and, I believe, other applications. Unfortunately, I've never been able to install it without a fight, one of which I documented in PPM has module but BugZilla says it's missing, and the goalposts seem to me to be highly mobile. I'm writing this in the hope that it will help people who are in the same position as I am and inspire those with the knowledge, power and tuits to make life a little easier for us lesser mortals. If you already know all these things, I will be wasting your time, but I had to do a lot of studying to work them out for myself. This is the short version.

The BugZilla installation instructions at make the process look easy. The only route suggested is the command line as follows:

C:\>ppm install Template-Toolkit Downloading Template-Toolkit-2.22...done Unpacking Template-Toolkit-2.22...done Generating HTML for Template-Toolkit-2.22...done Updating files in site area...done 140 files installed
What could possibly go wrong? Well, it appears that ActiveState no longer serves TT, at least for 64 bit 5.16.2. At this point, I went off on a useless search. Google made it appear that there would be something useful at From here I went to the downloads page ( which talks about BugZilla. The links to ppm packages seemed to be exactly what I wanted. At this stage I was getting really optimistic, until I clicked on the link for the ppm download for TT. If you want to see a 404 error, this is the place to go ( As I said, the goalposts do seem to move, so I entertain hopes that this may change to something other than a dead end.

The next thing I tried was CPAN. While I was ultimately successful, I approached it with great trepidation. My only previous attempt (documented at Raspberry Pi: some sort of dependency hell involving YAML) had not been a success, and the helpful advice to use something else still rang in my ears. I didn't think that AS would have written ppm if CPAN worked better all along. It didn't start well, either. It tried to install "dmake" and the MinGW c compiler (which I thought I had installed anyway with git) and failed. The process threatened "This may take a few minutes", but I have a fast, powerful computer that was running nothing else, as well as a fast internet link, so it only took about 20 minutes. Anyway, I have no idea whether these things are necessary nor, in the case of "dmake", what its purpose is, so I decided to keep trying.

CPAN's help (brought up by "h"), is more of the form of a memory jogger than something to get the beginner started. It assumes rather a lot of knowledge, especially about things like "make". I believe that dmake and nmake (of which more later) are Windows variants of make, but if someone corrects me they are more likely to be right than I am. But it suggests install so, following ppm, I tried install Template-Toolkit. This complained about being unable to find the package, but suggested using i. This returns a list of possibilities, but there is little or nothing to indicate what to do next. I don't know if it is what I want, but the incantation that seemed to give me progress was install ABW/Template-Toolkit-2.24.tar.gz.

The process started with the reporting of so many files that I couldn't scroll back to the start as the buffer (set to the maximum Windows will allow) wasn't large enough. It then complained about the lack of a c compiler and make utility and started - apparently - the same process that had taken 20 minutes to fail earlier. Another 20 minutes later, I was pleasantly surprised to see a report of success. I was also told Please use the `dmake` program to run commands from a Makefile! without any clue as to where to find dmake, what a makefile is or why I might want to run commands from one.

I then got a lot of text about Template::Stash::XS, followed by a pair of options where I used the defaults:

Do you want to build the XS Stash module? [y] y Do you want to use the XS Stash by default? [y] y

I suspect that these should not be chosen unless a c compiler is available, but as indicated earlier, I'm not absolutely sure what constitutes "available". Anyway, this produced some encouraging messages until a range of colours that I won't attempt to reproduce reported (I've tried to improve the wrapping):

Configuration complete. You should now run 'C:\Perl\site\bin\dmake.ex +e', 'C:\Perl\site\bin\dmake.exe test' and then 'C:\Perl\site\bin\dmake.exe install'. See the README file f +or further information. 'nmake' is not recognized as an internal or external command, operable + program or batch file. ABW/Template-Toolkit-2.24.tar.gz nmake -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: ABW/Template-Toolkit-2.24.tar.gz : make NO

First, the "dmake" commands have to be run in a way I didn't expect which I will explain in the next paragraph. Second, "the README" file is either missing or lost among all the others that exist on my machine. Third, the mention of "nmake" seems to be a total red herring. These can prove a vast time sink and certainly got me nowhere. I made further progress only when I gave up and tried to install again from scratch.

This failed with the message Has already been unwrapped into directory C:\Perl\cpan\build\Template-Toolkit-2.24-RFIUGI. However, this gives an important clue. Leaving the CPAN shell, I changed to this directory and then tried issuing the three "dmake" commands suggested earlier.

Bugzilla's checksetup routine now indicates that TT is present. Only 9 more modules to go.


John Davies

Replies are listed 'Best First'.
Re: Installing Template::Toolkit on Windows
by afoken (Chancellor) on Feb 22, 2013 at 14:24 UTC

    Smells like ActiveState's Perl. You essentially have two options other then messing around with a wild mix of PPMs provided by ActiveState and others and modules from CPAN:

    • Install MinGW via PPM, this is said to give you a working C compiler
    • Get rid of ActiveState's Perl and use Strawberry Perl, that comes preconfigured with a working C compiler, linker etc., and behaves as much as a Perl on a Unix system as possible.

    I've switched from AS to SP long ago, and never regretted it. I also (ab-)use SP to just get a free, working C compiler and linker for Windows.


    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: Installing Template::Toolkit on Windows
by BrowserUk (Patriarch) on Feb 27, 2013 at 17:00 UTC

    Hm. I issued the following sequence of commands into a command window:

    cd \perl64\packages wget " +-2.24.tar.gz" gunzip Template-Toolkit-2.24.tar.gz tar -xvf Template-Toolkit-2.24.tar cd Template-Toolkit-2.24 makefile to build the XS Stash module? [y] y to use the XS Stash by default? [y] y nmake nmake test ... All tests successful. Files=89, Tests=2762, 26 wallclock secs ( 0.70 usr + 0.23 sys = 0.94 + CPU) Result: PASS C:\PROGRA~2\MICROS~1.0\VC\Bin\amd64\nmake.exe test -nologo 'No tests defined for Template::Stash::XS extension.' cd ..

    The results after less than 2 minutes was T::T downloaded, unpacked, compiled, tested and ready to install.

    ASPerl 5.10.1 & MSVC.

    Full console log of the above:

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Oh, I wasted LOTS of time doing this. :-) I think, had I known how to do it, it wouldn't have taken much longer than your 2 minutes. The two 20 minute waits (and I didn't time them accurately - that's an estimate) were for the installation of the C compiler and ?make utility. Without that the computer time would have been much shorter. But even the 40 minutes for that was only a small part of the time I wasted not knowing what to do and googling frenetically. That's why I thought it might be worth putting up the OP in case someone found themselves in the same boat.

      I'm interested to see you using wget instead of the two tools I'd heard of previously. Is this documented anywhere? Especially, is there any documentation on which to use and when? As I stated in the OP, the only ones I've ever tried are PPM and the CPAN shell (I've also used Debian's apt-get on the Pi).


      John Davies

        I'm interested to see you using wget instead of the two tools I'd heard of previously. Is this documented anywhere?

        wget is just a GNU download tool -- you can get a binary version for Windows from here -- but you can download the tar.gz using any other tool or method including just clicking the link on the CPAN website for whatever package you want.

        I long ago gave up on CPAN(P/plus/whatever) because they:

        • insist downloading stuff that I neither need nor want;

          Like some ancient version of nmake that hasn't worked for building perl modules since pre-5.6.1 days. If then. It is well-known that it is a pointless exercise to install that; but still the CPAN shell will insist on downloading it even when there is a working, up-to-date version already installed and available via the path! Shear bloody-mindedness.

        • Insist on installing alternative compiler & tool chain that don't work, rather than using the already installed compiler that does, simply because the broken algorithm they use to look for the compiler -- that does everything but the sensible thing of searching the path -- cannot find it.
        • Insist on trying to provide a broken emulation of *nix command line history functionality; when my shell has its own history facility -- that works -- built-in.
        • Insist on fucking with my carefully chosen shell color settings in order to try and highlight random bits of output in random colors according to no discernible pattern; and rendering the output entire unreadable in the process.

        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Installing Template::Toolkit on Windows (ghost story)
by Anonymous Monk on Feb 22, 2013 at 14:57 UTC

      Your first URL is one that I looked at. I rejected it because it says:

      You must understand that these installers are provided for testing purposes only and are only available for older versions of Bugzilla. These older versions are vulnerable to several security issues and so shouldn't be used for production.


      John Davies

        apache friends - xampp for windows

        Apache 2.4.3 MySQL 5.5.27 PHP 5.4.7 phpMyAdmin FileZilla FTP Server 0.9.41 Tomcat 7.0.30 (with mod_proxy_ajp as connector) Strawberry Perl Portable XAMPP Control Panel 3.1.0 (from hackattack142)
Re: Installing Template::Toolkit on Windows
by sundialsvc4 (Abbot) on Feb 27, 2013 at 13:50 UTC

    I’ll second the motion that Strawberry is probably a better way to go on Windows, if you need to install anything other than through AS’s sometimes dated packages.   The experience is roughly akin to trying to maintain a Perl setup on a Linux box strictly through the use of a distro’s packaging system.   It works, to a degree, but you outgrow it in due time, and when you do, there’s nowhere to grow.   AS had a wonderful concept and did it reasonably well, but then you start bumping into its margins.

      The last time I tried to get Strawberry working, it didn't play nicely with Win32::OLE and Excel. I'd be delighted to hear that all such issues are closed, but the BugZilla instructions recommend AS, so I prefer situations in which I can point would-be helpers to the instructions I am trying to follow rather than making up my own as I go along.


      John Davies

        Now that is downright interesting, because I certainly have never found that to be the case.   I use Strawberry quite a bit in connection specifically to Excel (and Outlook), specifically using OLE ... (so much for being “a troll”) ... and have never encountered a lick of trouble with it.

        The key difference, if there is any (and I doubt), is that, yes, you do need to have a compiler on-hand to do a lot of these things in the Windows environment ... which Strawberry takes care of and which AS (I do believe by design) generally seeks to avoid [the need for].   AS seems to strive to do things “the Windows way,” if you will, whereas Strawberry appears in like manner to do things much closer to the way that the same things are done in Linux/Unix.

        Certainly, it has never been my experience ... and (sorry, “troll-UK,” but I do have “experience” here) ... that Strawberry was in any way “problematic” with regards to using OLE.   Therefore, I have no clue where that recommendation comes from.   Perl technology worked splendidly, as did Strawberry, as did OLE.

      Iíll second the motion that

      you sir are a troll

Re: Installing Template::Toolkit on Windows
by Anonymous Monk on Jul 17, 2013 at 08:38 UTC
    You are da MAN! Thank you so much for posting this!

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://1020161]
Front-paged by Arunbear
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2024-07-21 23:38 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.