[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: MV Debug Statements
****** message to minivend-users from Joe Hourcle <oneiros@dcr.net> ******
On Thu, 25 Feb 1999, Barry Treahy wrote:
> ****** message to minivend-users from Barry Treahy <treahy@mmaz.com> ******
>
> Mike, I'm not a Perl expert and need a direct answer. I've had numerous
> postings about problems with MV, probably my technique but still no
> help, and when I enable debugging, different parts of MV begin to
> mis-behave.
>
> With debugging enabled, there are a lot of "Use of uninitialized value
> at" errors, many in GDBM and other modules and my question is,
>
> does Perl continue an execution stream even if an error occurs? I have
> pages that work without debugging, but when enabled, they stop saving
> data, specifically with userdb. I need to know if I'm creating more
> work trying to use the debug data than the aid it is providing me...
'Use of uninitialized value' normally means that a variable was called,
and was considered undef (roughly, NULL)
normally, programs will run with those errors messages, however, there is
a possiblility that some things will break:
eg.
printf OUTPUT "%s will give an error\n",$blah;
will give an error, if $blah has not been defined. Your sometimes get it
in arrays, when array is smaller than you thought.
eg.
($id,$descrip,$qty,$crap,$etc) = @array;
if @array is smaller than 5 items, $etc is undef, and will give those
errors each time it's called in some context that needs it to have a
value.
Sometimes, depending on the chances of your data being incomplete, it's
good to do something like:
($id,$descrip,$qty,$crap,$etc) = @array;
$descrip = '' if (!defined($descrip));
$qty = '' if (!defined($qty));
$crap = '' if (!defined($crap));
$etc = '' if (!defined($etc));
-----
Joe Hourcle
Digital Crescent, Inc.
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list