in reply to SQL in Perl and setting variables

It depends of how do you want to manage your database.

If you want a portable code, you should use DBI
You can also search for an ODBC driver for Oracle and then use Win32::ODBC or Win32::OLE and Win32::ADO.
You can get info about recorsets and so on to extract your data.
See DBI, and Win32::ODBC and Win32::ADO and Win32::OLE or make a SuperSearch on this terms
Remember that if you use activestate perl, you should install DBI if you want to use it.
(It is not part of the distribution)
Hope this helps
Hopes