use magic_columator; while(my @row = $col->fetchrow) { # do stuff }