in reply to Re^5: How to check if an array element reference exists or not
in thread How to check if an array element reference exists or not

Thanks again for the reply.

I'm not using strict as I'm just writing a function to complement code that somebody else has written.

I ran the dumper on $rowand it spit out a 3200KB text file.

So instead, I ran the Dumper on print Dumper ($row->[7]); and got $VAR1 = \undef;.

Running if (defined ($row->[7]) ) when $row->[7] is \undef; returns true. I'm guessing that the reference is causing this?

Replies are listed 'Best First'.
Re^7: How to check if an array element reference exists or not
by Anonymous Monk on Apr 14, 2010 at 10:51 UTC
    I'm guessing that the reference is causing this?

    What is this guessing?

    $ perl -le"print \undef" SCALAR(0x3d5790) $ perl -le"print defined \undef" 1 $ perl -le"print \1" SCALAR(0x3d8284) $ perl -le"print defined \1" 1