drodinthe559 has asked for the wisdom of the Perl Monks concerning the following question:

Can I use Win32::ODBC on Linux? I just want to know before I spend too much time on it. I think the answer is yes, but want to be sure. The perl script is used to connect to a MS SQL Server. Thanks, Dave

Replies are listed 'Best First'.
Re: Cheesy Win32 Question
by ikegami (Patriarch) on Dec 29, 2009 at 21:41 UTC

    Can I use Win32::ODBC on Linux?

    No.

    Makefile.PL:

    unless ($^O eq "MSWin32" || $^O eq "cygwin") { die "OS unsupported\n"; }

    ODBC.xs:

    #include <windows.h>

    But you can use UnixODBC and DBD::ODBC. Unless you have a reason to go low level, you're better off going with DBI (and thus DBD::ODBC) even if you could use Win32::ODBC.

Re: Cheesy Win32 Question
by zwon (Abbot) on Dec 29, 2009 at 21:45 UTC

    I just took a look on Makefile.PL and it looks like no, you can't use it on Linux. Maybe DBD::ODBC is what you looking for.

      It looks like its a unanimous "NO". Thanks for answering.
Re: Cheesy Win32 Question
by jmcada (Acolyte) on Dec 30, 2009 at 02:13 UTC
    You might want to take a look at http://www.perlmonks.org/?node_id=392385 though.