http://www.perlmonks.org?node_id=11125757

SergioQ has asked for the wisdom of the Perl Monks concerning the following question:

PLEASE IGNORE THIS QUESTION, I FEEL SO STUPID FOR POSTING IT. I WAS USING undef WHEN I SHOULD HAVE BEEN USING !define. Sorry

A delete question feature would be nice.

This is a new question but related to a recent post here of mine Having problems with DBI selectall_arrayref

Using the solution from my previous post, it works, and I can access both my column, and data from my MySQL table.

The data is there, but I am having problems finding empty fields. For instance the code below, loops through the hash, gives me the key(column) and value(MySQL field).

However, every item comes up as defined but empty, even though the code prints out its contents. You can see how far I've tried , i.e. moving the text from the hash to a new scalar.

my %currec; foreach my $row (@{$data_all}) { say $row; %currec = %{$row}; foreach my $columns (keys %currec) { my $text = $currec{$columns}; say $text; if(undef($text)) { say "$columns is NOT DEFINED"; } elsif (length($text) < 1) { say "$columns DEFINED, but empty"; } } exit; }