Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Template toolkit Adding Values to Variable

by CountZero (Bishop)
on Mar 01, 2010 at 12:22 UTC ( [id://825892]=note: print w/replies, xml ) Need Help??


in reply to Template toolkit Adding Values to Variable

Could it be that there is something wrong with the Perl-script that stuffs data in the TT-variables?

Have you checked what is in information.QTY and information.PRICE? Or perhaps shopping is zero or empty or undef and the loop doesn't run?

Does TT know the += operator (as in [% totalprice += ff %]? Have you tried [% totalprice = totalprice + ff %]? (Sorry, I cannot check on the computer I am writing this on).

Update: Added question on += operator

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: Template toolkit Adding Values to Variable
by seekperlwisdom (Acolyte) on Mar 01, 2010 at 12:32 UTC

    Thanks for reply,

    everything runs perfect except for the updating the [% totalprice %] variable. seem like [% totalprice   %] is reset or become private varible when it is inside the [% FOREACH %]. it is just creating global variable which can update or value can be pushed in it.

    regards.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://825892]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-19 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found