--- Michael Fowler <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 24, 2001 at 03:24:46PM +0200, Birgit Kellner wrote:
> > --On Donnerstag, 23. August 2001 11:03 -0800 Michael Fowler 
> > <[EMAIL PROTECTED]> wrote:
> 
> > open (DB, "<$db_filname") or &cgierr("error in get_records. unable to open 
> > db file: $db_file_name.\nReason: $!"); #opens ok
> 
> Is that correct?  You're opening $db_filname, but printing out $db_file_name
> if there's an error.

Once again, we have an excellent example of why most Perl programs should start with 
"use
strict;".  In this particular case, the programmer would have declared "$db_filname" 
and strict
would have thrown an error when encountering the undeclared variable "$db_file_name".  
However,
from looking at how descriptive the other variable names are (they're spelled 
correctly and tend
not to be abbreviations, which is a Good Thing), I suspect that $db_filname is 
actually the
misspelling.  Is it $db_filname, $db_filename or $db_file_name?  When I'm searching 
through a
large section of code, I'm not likely to notice those subtle differences.

For programs more than a few lines long, how can anyone hope to catch all of the 
potential
misspelled variables?  I've had to maintain code that didn't use strict and I've 
discovered that
bugs that would take me a second or two to find and fix now take 1/2 hour or more.

Cheers,
Curtis Poe

=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to