You have not scoped @new_row to run_query(), so every time you call the function, you push values onto the same array. The solution to this is to write:
my @new_row;... just before the while loop. I encourage you to scope all of your variables lexically in the tightest possible scope; it will help you avoid many problems like this.
In reply to Re: Query Subroutine
by chromatic
in thread Query Subroutine
by Fuism
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |