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

Hi I need to find out if I have the correct perl ODBC drivers installed. I can list the modules, and can see various files and folders in the /usr/lib64/perl5 folder (Linux RHEL OS 6.5), but not sure how one can determine if the correct odbc drivers exist.

The version I need to check on is DBD::ODBC version 1.22. Im using Perl 5.10.

Im new to perl and programming, so any thoughts would be appreciated

Dee

Replies are listed 'Best First'.
Re: Perl ODBC Drivers
by Corion (Patriarch) on Oct 28, 2015 at 14:27 UTC

    See DBD::ODBC::FAQ:

    If you are running a packaged Linux like RedHat, Ubuntu, Fedora, Suse etc etc you'll usually find it packaged with unixODBC and using the package manager to install it is fairly straight forward. However, make sure that if the driver manager is split into multiple packages you install the development package as well as that contains the C header files required by DBD::ODBC.
Re: Perl ODBC Drivers
by stevieb (Canon) on Oct 28, 2015 at 14:25 UTC

    I don't have that module installed, but here's one example of checking a module's version:

    perl -MData::Dumper -e 'print $Data::Dumper::VERSION' 2.158

    So for DBD::ODBC, try this:

    perl -MDBD::ODBC -e 'print $DBD::ODBC::VERSION'
      Slightly better, assuming you have perl 5.10.0 or later:
      perl -MDBD::ODBC -E 'say $DBD::ODBC::VERSION'
      From perlrun
      -E commandline

      behaves just like -e, except that it implicitly enables all optional features (in the main compilation unit). See feature.
      Saves you two characters and adds a newline to the output.

      #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

        Yes, I'm aware and most often use -E. It was just early, and just in case someone tested it that doesn't have a recent enough version for say(). :) Good to point out for those who don't know. In a one-liner, say() is especially useful when iterating.