use OLE; use strict; my ($Conn,$RS) # open connection $Conn->Open("DSN=NameOfODBC;UID=sa;PWD=password;"); $RS = $Conn->execute("select * from table); $RS->Movefirst; while (!RS->EOF) { #... do processing of recordset } $Conn->Close