Another newbie question

J

Jockser

Hello, I'm trying to set up template toolkit to process a xml file and
poplulate the data elements into a template.

I'm trying to understand the example in O'Reilly's Perl Template Toolkit
book. But I'm not doing something right.

Here is what I'm doing:
I have a file named report.tt

[% USE inventory = XML.Simple('products.xml') -%]
[% FOREACH product = inventory.product.keys.sort;
current = inventory.product.$product -%]
[% current.id %] [% product %]
[%- current.stock | format('%5d') %] units @
[%- current.price | format('%6.2f') -%] =
[%- current.stock * current.price | format('%10.2f') %]
[%- total = total + current.stock * current.price %]
[% END -%]
Total value: [% total | format('%10.2f')%]

I try running this at the command prompt by typing:
tpage report.tt

and I get back:
plugin error - XML.Simple: plugin not found


If I check PPM I do have this installed:
38. XML-Simple [2.14] Easy API to maintain XML (esp config
file~

I don't know if I'm running this correctly by using tpage, or if it all
needs to go into a perlscript some how.
Any help would be appreciated!!

Thanks,
 
T

Tad McClellan

Jockser said:
Subject: Another newbie question


You will get more help if people can tell what you need help with.

Please put the subject of your article in the Subject of your article.

(You will also get more help if you don't put "newbie" in the Subject.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,054
Members
48,769
Latest member
Clifft

Latest Threads

Top