Without use strict.
so you've a script that does a connect then lots of stuff.
$dbh = DBI->connect( ... ) ...
...
$sth = $dbh->prepare( ... )
... lots of stuff.
$sth2 = $dbh->prepare( ... )
$sth3 = $dbh->prepare( ... )
$sth4 = $dbh->prepare( ... )
$sth5 = $dbi->prepare( ... )
$sth6 = $dbh->prepare( ... )
Everything, works until the condition that uses $sth5 are called, then
the script dies with a "undefined prepare ..."
With use strict, this script doesn't compile until you've added:
my $dbh = DBI->connect( ... ) ...
...
my $sth = $dbh->prepare( ... )
... lots of stuff.
my $sth2 = $dbh->prepare( ... )
my $sth3 = $dbh->prepare( ... )
my $sth4 = $dbh->prepare( ... )
my $sth5 = $dbi->prepare( ... )
my $sth6 = $dbh->prepare( ... )
But wait, the compiler spots that $dbi is not declared in line xxx.
This is a very simple, but often encounter, problem.
Also, use strict forces you to write better code, well attempts too.
Something I've seen in Randal Schwartz's Web Techinques: "I use this on
any program that's more than 10 lines long that I use for more than 10
minutes (what I call my "10 - 10" rule)." Referring to -Tw and use
strict.
Tom
On Fri, Feb 02, 2001 at 09:54:43AM -0500, Stewart, Clay wrote:
> What are the exact disadvantages of not placing 'use strict' when using DBI
> with DBD::Oracle ?
>
> I read a lot everywhere to 'use it or else', 'always use it', 'you really .
> . . really should use it' . . . but have not been able to find an
> explanation of why in detail.
>
--
Thomas A. Lowery [EMAIL PROTECTED]
http://tlowery.hypermart.net
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com