http://qs321.pair.com?node_id=431955


in reply to How to use undef in DBI sql query result collection

You're missing a my:

while (my @data = $sty->fetchrow_array()) {

rdfield

Replies are listed 'Best First'.
Re^2: How to use undef in DBI sql query result collection
by dragonchild (Archbishop) on Feb 17, 2005 at 14:41 UTC
    You're missing a my:

    How do you know? Snippets were shown, not necessarily running code. Maybe @data is scoped higher than the while-loop for other reasons. Maybe strict isn't being used in this code for various reasons. (Did you know that CGI doesn't use strict?) There are a ton of completely legitimate reasons why a my may have been left out. Commenting upon it without actually helping out the OP is a complete waste of my time, for having to read your reply.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.