avo has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,
I have an issue retrieving some cgi data via Template Toolkit CGI plugin. <vr>I don't know what I must do in order to get "Previous value" ([%mycgi.param('lval_' rec1.h_num)%] check below):

[% USE mycgi = CGI %] <html> <form> .... [%FOREACH rec1 IN thedata.rec%] <input type="text" name="lval_[%rec1.h_num%]" value="[%rec1.h_win%]"/> CGI parameter name: [%'lval_'; rec1.h_num%] Previous Value: [%mycgi.param('lval_' rec1.h_num)%] <hr> [%END%] <input type="submit" name="Submit" value="Submit" /> .... </form> </html>


If I try to make the tag look like [%mycgi.param('lval_'; rec1.h_num)%]
I get an error "unexpected end of directive..." All help is highly appreciated.

Replies are listed 'Best First'.
Re: TT2 and Plugin CGI
by perrin (Chancellor) on Oct 07, 2007 at 20:05 UTC
    In Template::Manual::Directives it says "You can concatenate strings together using the ' _ ' operator."
      Thanks! I must have missed that while going through the manual :) Take care!