[Templates] sending perl hash to template

allan lambretta@inet.uni2.dk
Sun, 29 Sep 2002 21:39:19 +0200


hi

i couldn't find it in the docs.
i have a complete hash in my main perl prgoram which i want to use in
a template.
can i do something like the snippets below to use the whole hash as it
is (or a reference) in the template?

thanks
./allan



Example:

my %person = (
  id    => 314, 
  name  => 'Mr. Blue',
  email => 'blue@nowhere.org',
);  


my $vars = {
  person  => %person,  
  # or maybe \%person,
};



template:

[%-  
FOREACH individual = person;
  person.individual;
END;
-%]