On Thu, Apr 08, 2010 at 05:20:36PM -0400, Shawn Scott wrote:

>When I run this code it gives me the correct number of elements, based on
>the number of errors in the loop @error array. The only issue each one is
>shown as the last line pushed to the @error_loop.

Well, yes. You're defining a single hash and pushing multiple references
to it. Chech out perldoc perlref...

For this specific problem, cut out the middleman:

my @error = @_;
  my @error_loop = ();
  print header;
  foreach (@error) {
    push(@error_loop, {ERROR_DATA => $_});
  }
  my $template = HTML::Template->new(filename => 
"$html_root/signup_error.html");
  $template->param(ERROR_LOOP => \...@error_loop);
  print $template->output;

Roger

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to