Re: [htmltmpl] HTML::Template Loop Issue

2010-04-08 Thread Shawn Scott
Wow, embarrassing I missed that? At any rate thanks for all the quick replies. On Thu, Apr 8, 2010 at 5:30 PM, Lyle wrote: > Problem with your hash scoping:- > > > my @error = @_; my @error_loop = (); > print header; > foreach (@error) { > my %error_data; > > $error_data{ERROR_DATA}

Re: [htmltmpl] HTML::Template Loop Issue

2010-04-08 Thread Sam Tregar
Put the 'my %error_data;' inside the loop. You're pushing a reference to the same hash over and over again. -sam On Thu, Apr 8, 2010 at 5:20 PM, Shawn Scott wrote: > Good Afternoon, > > I have been using HTML::Template for some time and have recently run into > an starnge issue. I have the fol

Re: [htmltmpl] HTML::Template Loop Issue

2010-04-08 Thread Alex Teslik
On Thu, 8 Apr 2010 17:20:36 -0400, Shawn Scott wrote > Good Afternoon, > > I have been using HTML::Template for some time and have recently run > into an starnge issue. I have the following code > > my @error = @_; > my @error_loop = (); > my %error_data; > print header; > foreach (@err

Re: [htmltmpl] HTML::Template Loop Issue

2010-04-08 Thread Roger Burton West
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

Re: [htmltmpl] HTML::Template Loop Issue

2010-04-08 Thread Lyle
Problem with your hash scoping:- my @error = @_; my @error_loop = (); print header; foreach (@error) { my %error_data; $error_data{ERROR_DATA} = $_; push(@error_loop, \%error_data); } -- Download IntelĀ® P

[htmltmpl] HTML::Template Loop Issue

2010-04-08 Thread Shawn Scott
Good Afternoon, I have been using HTML::Template for some time and have recently run into an starnge issue. I have the following code my @error = @_; my @error_loop = (); my %error_data; print header; foreach (@error) { $error_data{ERROR_DATA} = $_; push(@error_loop, \%error_data