The DBI module converts SQL's NULL value into Perl's undef, and vice versa. You're getting a warning because one of the rows you're fetching has a column with a NULL value, which gives undef for one of the elements in @data. (For example, @data might be
(7, 'Bob', undef, 'bob@example.com'). You could simply turn off warnings local to the block, since the warning isn't pointing out an actual problem.
This conversion between NULL and undef can also be seen with $dbh->quote(undef), which returns the string 'NULL'. undef can also be used with placeholders to get a NULL value in SQL.