Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: AoH refs for setting HTML::Template loops

by jeffa (Bishop)
on May 08, 2004 at 14:33 UTC ( [id://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)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-26 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found