in reply to I really need help with perl data structures and HTML::Template
then you can iterate through @domains like this. And you test print statment will work (formated slightly different).while(my $row=$sth->fetchrow_hashref()){ push @domains, $row; }
Then calling HTML::Template with this code:print "$domains[0]->{subdomain}\n"; my $d; foreach $d(@domains){ print "$d->{subdomain}\n"; }
and this templatemy $template=HTML::Template->new(filename=>'test.tmpl'); $template->param(DOMAINS => \@domains); print $template->output();
produces the desired result (at least off of my DB and PERL).<TMPL_LOOP NAME=DOMAINS> Subdomain: <TMPL_VAR NAME=SUBDOMAIN> </TMPL_LOOP>
Most of the problems you are having seem to be related to perl datastructures and references. When you get a chance you should read the perldsc and perlref documents that come with perl. They should put you on the right track with datastructures and references
|
|---|