in reply to Re^4: How to check if an array element reference exists or not
in thread How to check if an array element reference exists or not
The point of using Data::Dumper is to get a textual representation of a data structure, so there is then no need to resort to screenshots of a debugger showing a scrolled window of a data structure.
Your debugger is misleading you. You are either not using strict, or you have two variables declared, @row and $row. They are different.
You seem to be wanting to check whether the 8th element in the array referenced by $row is defined, but you check whether the 8th element in the array @row is defined.
Again, use Data::Dumper to look at the data structure you're testing instead of relying on visual inspection combined with guesswork as to what data structure your code really is looking at.
if (defined $row->[7]) { ...
should work, according to my interpretation of the dump you show in the offsite link to a screenshot showing your debugger showing a data structure and some code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: How to check if an array element reference exists or not
by corpx (Acolyte) on Apr 14, 2010 at 10:04 UTC | |
by Anonymous Monk on Apr 14, 2010 at 10:51 UTC |