Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://351714]
help
Chatterbox?
[Discipulus]: good morning vietnam!
[Discipulus]: but there is some perl workshop somewhere? I notice many high level monks disappeared.. we can make PM a squat in the meantime ;=)
[karlgoethebier]: Discipulus: Mmh, who disappeared?
[marto]: morning all
[shmem]: perl -lE '$_="odd mornin";($o=$_)=~ s/^|$/g/g;say$o'
[Eily]: Hi monks o/

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2017-06-27 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (600 votes). Check out past polls.