in reply to Value Pair Assignment

Hi Ryan,

Just call me stupid, but I don't see what the problem is :-).
HTML::Template::param is a subroutine which takes two arguments, a key and a value. Of course you can loop over a hash and change the keys or values as arguments of the param sub.

This has nothing to do with HTML::Template as such, but it works for every sub or command (like print, etc...).

Perhaps post some actual code so I can understand your problem.


---------------------------
Dr. Mark Ceulemans
Senior Consultant
IT Masters, Belgium

Replies are listed 'Best First'.
Re: Re: Value Pair Assignment
by Anonymous Monk on Apr 18, 2002 at 17:38 UTC

    param does not take two arguments. It takes a list of key/value pairs. Read the documentation next time.

    $tmp->param( foo => 'bar', baz => 'quux' ); # or $tmp->param(%pairs);
Re: Re: Value Pair Assignment
by ryan (Pilgrim) on Apr 18, 2002 at 08:17 UTC
    I didn't realise HTML::Template::param took two arguments

    firstly) because I was not aware of the functionality of '=>' and that it was actually passing two parameters and not one. secondly) because every example I have ever seen that taught me to use it was of the form 'variable => value'.

    Simple problem, simple solution - All in a day's learning.