in reply to Re: Re: Voting script using MySQL and DBI
in thread Voting script using MySQL and DBI

Or even better:
my $dbh = DBI->connect( "DBI:${dbtype}:${dbname}", $dbuser, $dbpass), {RaiseError => 1}, ); # oops! $dbh->prepare('slecet foo from baz');
Now every database method will raise an error automatically if one is encountered - Laziness! And get out of the habit of putting quotes around variables when you don't need to.

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)

Replies are listed 'Best First'.
Re: (jeffa) Re: Voting script using MySQL and DBI
by lagrenouille (Acolyte) on Sep 01, 2002 at 02:21 UTC
    G'day jeffa

    I'll certainly take this on board, but why is this ?

    "And get out of the habit of putting quotes around variables when you don't need to."

    Cheers
    lagrenouille

      Stringifying some things (objects, especially) ruins them for normal use. Plus, it's useless.