Re: [Templates] hashes and loops

[prev] [thread] [next] [Date index for 2004/10/21]

From: Sean McAfee
Subject: Re: [Templates] hashes and loops
Date: 14:34 on 21 Oct 2004
Dave Cash <dave@xxxxx.xxx> wrote:
>Perhaps I'm not following exactly what you're trying to do, but
>could you just do this?
>
>  push @notes, $rowref while my $rowref = $sth->fetchrow_hashref;
>
>or if that doesn't work:
>
>  while ( my $rowref = $sth->fetchrow_hashref ) {
>    push @notes, $rowref;
>  }

The references returned by fetchrow_{array,hash}ref are all references to
the *same* array or hash, so if you did this you'd wind up with an array of
multiple references to the same hash, containing the last row returned by
the query.


        -- 
        Sean McAfee -- mcafee@xxxxxxxxx.xxx

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

(message missing)

[Templates] hashes and loops
Brandon Hall 19:03 on 19 Oct 2004

Re: [Templates] hashes and loops
Sean Kellogg 19:10 on 19 Oct 2004

Re: [Templates] hashes and loops
Brandon Hall 06:51 on 21 Oct 2004

Re: [Templates] hashes and loops
Michael 13:44 on 21 Oct 2004

Re: [Templates] hashes and loops
Michael 13:58 on 21 Oct 2004

Re: [Templates] hashes and loops
Dave Cash 13:47 on 21 Oct 2004

Re: [Templates] hashes and loops
Sean McAfee 14:34 on 21 Oct 2004

Re: [Templates] hashes and loops
Trond Michelsen 14:44 on 21 Oct 2004

Re: [Templates] hashes and loops
Mark Mills 15:22 on 21 Oct 2004

Re: [Templates] hashes and loops
Darren Chamberlain 19:13 on 19 Oct 2004

Re: [Templates] hashes and loops
Simon Wistow 20:54 on 19 Oct 2004

Re: [Templates] hashes and loops
Brandon Hall 23:56 on 21 Oct 2004

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52