Page 1 of 1

template toolkit perl and xampp

PostPosted: 23. November 2011 20:57
by sobank
Ok. so I am a total noob.

I set up a xampp 1.7.4 ........works great. mysql and apache are perfect. Used them for setting up for a php site for my school assignment.
Now we are suppose to set up a perl site with template toolkit. And after whole 8 hours of search, I can not find a proper installation guide etc. Everything that i find is either about unix or bugzilla etc.
So here is what I want............ set up a page that uses template toolkit.
I have active perl installed on my computer which was apparently needed for komodo. I can uninstal if needed.

Now I found out that I need ppm to install toolkit. I tried that......... it would always uses the active perl that is outsisde xampp. So no success on that front either.

So people please help me out here. I need some detail info on it. I am failing my course simply because i can not get the server to set up for template toolkit.

Please help me out here.

Re: template toolkit perl and xampp

PostPosted: 24. November 2011 00:27
by JonB
Look in the \xampp\perl\bin folder for a file called ppm.bat (its a package installer)

Code: Select all
C:\xampp\perl\bin>ppm install Class-Accessor
Installing package 'Class-Accessor'...
Bytes transferred: 22554
Installing C:\xampp\perl\html\site\lib\Class\Accessor.html
Installing C:\xampp\perl\html\site\lib\Class\Accessor\Fast.html
Installing C:\xampp\perl\html\site\lib\Class\Accessor\Faster.html
Installing C:\xampp\perl\site\lib\Class\Accessor.pm
Installing C:\xampp\perl\site\lib\Class\Accessor\Fast.pm
Installing C:\xampp\perl\site\lib\Class\Accessor\Faster.pm
C:\xampp\perl\bin>


note - this is from my Win XP SP3 1.7.3 install. (and I did it some time ago)

There is also a cpan.bat, whihc might work for you.


Good Luck
8)

Re: template toolkit perl and xampp

PostPosted: 24. November 2011 05:00
by Sharley
sobank, reproducing error messages for us to look at is more helpful than just saying that you did not have any success with ppm.
Remember we can't see your screen from here. ;)

The ppm.bat file is also present in 1.7.4 version but it seems to not produce the same results as in 1.7.3
(which I can concur with JonB that his code snippet is as how my 1.7.3 behaves also)
Code: Select all
G:\xampp174\perl\bin>ppm install Class-Accessor
Failed to load PPM_DAT file
Can't use an undefined value as a SCALAR reference at G:/xampp174/perl/site/lib/PPM.pm line 1672, <DATA> line 41.
G:\xampp174\perl\bin>
Tried it a few different ways with the same error.

1.7.7 also produces this error.
Code: Select all
G:\xampp177\perl\bin>ppm install Class-Accessor
Failed to load PPM_DAT file
Can't use an undefined value as a SCALAR reference at G:/xampp177/perl/site/lib/PPM.pm line 1672, <DATA> line 41.
G:\xampp177\perl\bin>

sobank, do you need to use 1.7.4 as it is not a recommended release, too many issue with it ?
viewtopic.php?f=16&t=44327

1.7.3 was a much more stable release for your Perl needs.
All XAMPP for Windows versions can be found here:
SourceForge XAMPP File Repository

Best wishes. :)

Re: template toolkit perl and xampp

PostPosted: 24. November 2011 06:27
by sobank
I didnt post any error code because one needs to run something to produce error code............ so far I have not even completed the running part :)

ok now I ran the command "xampp/perl/bin/ ppm install Class-Accessor " and I got the following out put

Code: Select all

C:\xampp\perl\bin>ppm install Class-Accessor
Installing package 'Class-Accessor'...
Bytes transferred: 7933
Installing \xampp\perl\site\lib\Class\Accessor.pm
Installing \xampp\perl\site\lib\Class\Accessor\Fast.pm
Installing \xampp\perl\site\lib\Class\Accessor\Faster.pm
C:\xampp\perl\bin>


So now what should I do?

1.7.4 is not necessary but I have the database on it and frankly I have no idea how to transfer it.

Anyways......... so am I suppose to do something else or am i ready to do the template toolkit thing. Cause that is what I want to do. My ultimate goal is to host the tt2 file and perl file.

How do i get the template toolkit working on it???

Re: template toolkit perl and xampp

PostPosted: 24. November 2011 13:58
by JonB
@ Sharley -

In his original post he was referring to PPM.EXE, which is ActivePerl's Perl Package Manager (now deprecated). That's why he didn't have any error messages.

@ Sobank -

I was showing how ppm.bat is a substitute for PPM.exe -

I guess you should read this page -

http://template-toolkit.org/download/index.html

This is an advanced Perl topic and I'm unsure if you will be able to resolve all the issues - many are specific to the Windows OS. I' going to try to assess your chances

Edit:
CPAN Template has many dependencies and requires a lot of knowledge to get going
Not happening you have to build/makefile - needs too many fixes (YAML, the nmake issue, cl.exe, paths etc)


Good Luck
8)

Re: template toolkit perl and xampp

PostPosted: 24. November 2011 20:36
by JonB
OK -

Here's a package that will work -

A - Install current ActiveStates Perl -

http://www.activestate.com/activeperl/downloads

B. Once installed open a command window at c:\perl\bin
Code: Select all
c:\Perl\bin>ppm install Template-Toolkit


http://code.activestate.com/ppm/Template-Toolkit/

Code: Select all
C:\Perl\bin>ppm install Template-Toolkit
Downloading Template-Toolkit-2.22...done
Downloading AppConfig-1.66...done
Unpacking Template-Toolkit-2.22...done
Unpacking AppConfig-1.66...done
Generating HTML for Template-Toolkit-2.22...done
Generating HTML for AppConfig-1.66...done
Updating files in site area...done
 154 files installed

C:\Perl\bin>


Write your Perl Scripts and place them in \xampp\cgi-bin

make the shebang line -
Code: Select all
#!C:/Perl/bin/perl.exe --


call your script http://localhost/cgi-bin/test.pl

Works -

Good Luck

Re: template toolkit perl and xampp

PostPosted: 25. November 2011 10:59
by sobank
will try tonight and if this works, dude i will be forever in your debt.

Re: template toolkit perl and xampp

PostPosted: 15. June 2012 05:41
by sobank
LOL. oh god. my life is a real funny sitcom.

I tried this didnt work. My professor gave me a usb xampp server. worked like a charm. I completed the assignment on usb stick. when it was time to hand over the assigment, someone broke into my locker and stole my bag. Went along with that bag was my dear assigment. dont need to tell you guys that i had no copy of my assignment cause it was not working on anything so never made a copy and who would steal a usb stick.

well i was stupid. learnt my lesson.

So started back from zero. funny thing is this time JonB instructions worked out and I got my server running tt2. So atleast now I can have my server going on so i can start the assignment ...........again.

anyways. Now i need one more thing to do. I have to show my work. so I need a usb server. I installed xampp on my usb stick. Now I am wondering how do i get the usb server to run tt2.

Any idea how to install template toolkit on usb portable xampp server????

Re: template toolkit perl and xampp

PostPosted: 15. June 2012 08:26
by JonB
That's a stumper for me (at least right now)

I'm not sure if you can install ActiveStates Perl to the root of your USB drive - that would be the thing to do.

Good Luck
8)