APM: Dumb program acting funny...

Tim McDaniel tmcd at panix.com
Thu Oct 19 11:02:58 PDT 2006


On Thu, 19 Oct 2006, CaptNemo <CaptNemo at Austin.rr.com> wrote:
> NULL values in variables are what gave the warnings.

I think someone mentioned that as a possibility.

> I left the w parameter but added:
>        if ($row){
>                print "$row,";
>                }
>        else {
>                print ",";
>                }
> and it worked fine.

Is there a chance that $row will be present but 0 or ''?  That would
also cause it to be not printed, which I suspect is not what you want.

I'd suggest
     if (defined $row)
for that reason.  Actually, I'd likely start with
     $row = '' if ! defined $row;
(if it's OK to clobber the variable), or
     print (defined $row ? $row : ''), ",";
(otherwise).

-- 
Tim McDaniel, tmcd at panix.com


More information about the Austin mailing list