Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

(jeffa) 2Re: Get a hash object from a database with DBI for use with HTML::Template

by jeffa (Chancellor)
on Aug 04, 2002 at 17:12 UTC ( #187503=note: print w/ replies, xml ) Need Help??


in reply to Re: Get a hash object from a database with DBI for use with HTML::Template
in thread Get a hash object from a database with DBI for use with HTML::Template

"Add a || die $DBI::errstr to all ... "

Too much typing, especially after the code has already been typed. Just add {RaiseError => 1} to connect():
my $dbh = DBI->connect( "dbi:mysql:mydb", "user", "pass", {RaiseError => 1}, );

"Dont use a & in a sub call without needing it. It overrides any prototype you may add ..."

Perl prototypes really are not very good, IMHO. I prefer to avoid them, opting for good documentation instead. Check out (tye)Re: A question of style for some good info.

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 (jeffa) 2Re: Get a hash object from a database with DBI for use with HTML::Template
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (14)
As of 2015-07-02 10:33 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 (33 votes), past polls