Re: [htmltmpl] (newbie) How to populate an array of hash references one by one?
Brought to you by:
samtregar
From: Puneet K. <pk...@ei...> - 2003-11-25 07:26:24
|
On Nov 25, 2003, at 1:18 AM, Ken Corey wrote: > On Mon, 2003-11-24 at 20:19, Puneet Kishor wrote: >> This comes up frequently. Maybe the explanation(s) should be added to >> the H::T docs (htdocs!) > > Might be a good idea! yeah... maybe Sam T might consider adding something like what I wrote up... something that directly ties using DBI with H::T, because inevitably someone will want to use MySQL or some such. > >> $template->param('result' => $sth->fetchall_arrayref({})); > > Thanks for pointing this out, the '({})' to arrayref would have thrown > me for a loop...uh...no pun intended. > >> You can construct this programmatically if you are reading >> sequentially >> from a file. > > Thanks, this info allowed me to get it working in less than 30 seconds. > Yay! I /knew/ it was something simple. > >> Please always use strict and -w. > > The first two lines of my cgi script are: > > #!/usr/bin/perl -w > use strict; > > When you say to "use -w", is that sufficient? well, no... I really meant what you already have #/usr/bin/perl -w use strict; you can also "use diagnostics" or splain if you really want a chatty system. > What about if it's being > run under mod_perl and Apache::Registry so that line isn't, as I > understand it, being invoked. Does the perl still check to see if > there > are invocation flags on the first line and respect them? > dunno. I don't use mod_perl or A::R. I am cc-ing this to the list (as you should do also) because someone else would likely have the answer to this (and other questions). |