while (my @prev = $sql->fetchrow_array()){ $$prev[1]=$prev[2]; }