Re: [htmltmpl] (newbie) How to populate an array of hash references one by one?
Brought to you by:
samtregar
From: Ken C. <ke...@ke...> - 2003-11-25 07:10:19
|
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! > $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? 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? Hrm... -Ken |