Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: AoH refs for setting HTML::Template loops

by jeffa (Bishop)
on May 08, 2004 at 14:33 UTC ( #351714=note: print w/ replies, xml ) Need Help??


in reply to AoH refs for setting HTML::Template loops

Where is the data? What does it look like? Why are you splitting data retrieved from a database? Why didn't you design your database to handle this instead? Why are you calling the subroutine execute_it with no arguments? And why aren't you using Data::Dumper for debugging your data structures?

So many problems bradcathey. Try this instead: (untested)

use DBI; use HTML::Template; use Data::Dumper; my $dbh = DBI->connect( qw(DBI:vendor:database:host user pass), {RaiseError => 1}, ); my $username = 'jeffa'; my $branches = $dbh->selectall_arrayref( 'SELECT branches FROM users WHERE username = ?', {Slice => {}}, $username, ); warn Dumper $branches; my $tmpl = HTML::Template->new(filehandle => \*DATA); $tmpl->param(branches => $branches); print $tmpl->output; __DATA__ <tmpl_loop branches> <tmpl_var branches> </tmpl_loop>
and let me know how it goes. :)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)


Comment on Re: AoH refs for setting HTML::Template loops
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://351714]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2015-07-29 07:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (261 votes), past polls