#select the fields from the database $dbh = gsm::connect (); $sth=$dbh->prepare ("select * from meetings order by meetings.id"); $sth->execute (); my $results = $sth->fetchall_arrayref(); #cleanup $sth->finish; $dbh->disconnect(); open SAVE, '/some/file' or die "Cannot open file:$!"; #process the columns received, one at a time for my $row (@$results) { print SAVE join("\t", @$row)."\n"; } close SAVE;