+6  A: 

You need to load Template Toolkit first, with:

use Template;

To make sure that Template::Toolkit is properly installed on this system, from a console you could run:

perl -MTemplate -e0

If it returns without an error, it means Template.pm wsa loaded succesfully; if not, it will give you an error of "Can't locate Template.pm in @INC...".

David Precious
Hi David,Thanks for the response. I've added use Template; to the head of the script concerned before posting without any luck.The head of the script is as follows:use strict;use warnings;package KPS::TemplateToolkit;use Template;use KPS::Config;use KPS::Globals;Thanks
simnom
Out of interest, from a console, run something like:perl -MTemplate -e0- does it give you any error?
David Precious
By the way, I believe that TT's new() method expects a hashref of params, so your invocation should look like Template->new({ ... }) - that should not cause the error you're seeing, though.
David Precious
Thanks a million, this gives me some more ammo to hunt with.Thanks
simnom
A: 

The code you pasted is just fine.

Your problem is in code you haven't shown us yet because you thought it wasn't relevant.