dbi_determining_versions

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Subject: Re: Finding out ...
From: Richard Dice <rdice@pobox.com>
Date: Fri, 01 Sep 2000 08:41:10 -0400

http://www.perlfaq.com/faqs/id/151
> :-) Gabriel

Useful info, but not quite what Bob was asking for.
 
> "Bob Pombrio" <bob.pombrio@transportationpartners.com> on 09/01/2000 02:13:00 PM
> 
> To:   "Dbi-Users" <dbi-users@isc.org>
> cc:    (bcc: Gabriel Pfeiffer/Jeppesen/TMC)
> 
> Subject:  Finding out ...
> 
> Ok, Here is a stupid one....
> 
>   How do I find out what version of the DBI and DBD I am using?

$ perl -MDBI -e 'print "$DBI::VERSION\n"';

Alternatively, assuming that you're talking about stuff installed on your
system Perl installation, for /usr/bin/perl with a library inside of
/usr/lib/perl5, then

$ find /usr/lib/perl5/ -name DBI.pm -exec egrep VERSION {} /dev/null \;

Doing this on my system, I get:

/usr/lib/perl5/site_perl/5.6.0/i386-linux/Bundle/DBI.pm:$VERSION = '1.03';
/usr/lib/perl5/site_perl/5.6.0/i386-linux/DBI.pm:$DBI::VERSION = "1.13"; # ==> ALSO update the version in the pod text below!
/usr/lib/perl5/site_perl/5.6.0/i386-linux/DBI.pm:       my $dbd_ver = ${"$driver_class\::VERSION"} || "undef";
/usr/lib/perl5/site_perl/5.6.0/i386-linux/DBI.pm:               'Version' => $DBI::VERSION,
/usr/lib/perl5/site_perl/5.6.0/i386-linux/DBI.pm:               'Attribution' => sub { "DBI $DBI::VERSION by Tim Bunce" },
/usr/lib/perl5/site_perl/5.6.0/Apache/DBI.pm:$Apache::DBI::VERSION = '0.87';
/usr/lib/perl5/site_perl/5.6.0/Apache/Session/Store/DBI.pm:use vars qw($VERSION);
/usr/lib/perl5/site_perl/5.6.0/Apache/Session/Store/DBI.pm:$VERSION = '1.01';

>From this, you've got to pick out the line that answers your question.
I care about DBI, not Apache::DBI or Bundle::DBI.  And I care about the line
where the answer to the question is found.  Therefore,

/usr/lib/perl5/site_perl/5.6.0/i386-linux/DBI.pm:$DBI::VERSION = "1.13"; # ==> ALSO update the version in the pod text below!

This is what I care about.

The version of DBD that you are using depends on which DBD you are using.

The info that Gabriel gave you is good for figuring out which DBDs you
have on your system.  Or, you can just check out the DBD library
directory directly:

[rdice@luke rdice]$ cd /usr/lib/perl5
[rdice@luke perl5]$ find . -name DBD
./site_perl/5.6.0/i386-linux/auto/DBD
./site_perl/5.6.0/i386-linux/Bundle/DBD
./site_perl/5.6.0/i386-linux/DBD
[rdice@luke perl5]$ cd site_perl/5.6.0/i386-linux/DBD/
[rdice@luke DBD]$ ls -al
total 156
drwxr-xr-x    2 root     root         4096 Aug 18 14:23 .
drwxr-xr-x   22 root     root         4096 Aug 21 12:22 ..
-r--r--r--    1 root     root        10500 Jul 11  1999 ADO.pm
-r--r--r--    1 root     root         9028 Jul 11  1999 ExampleP.pm
-r--r--r--    1 root     root         2699 Jun 17  1999 NullP.pm
-r--r--r--    1 root     root        32871 Sep 29  1999 Pg.pm
-r--r--r--    1 root     root        18972 Jun  9  1999 Proxy.pm
-r--r--r--    1 root     root         4068 Jun 17  1999 Sponge.pm
-r--r--r--    1 root     root        13810 Sep 29  1999 dbd-pg.pod
-r--r--r--    1 root     root        42231 Jul  9 16:54 mysql.pm
[rdice@luke DBD]$ grep VERSION *
ADO.pm:    $VERSION = substr(q$Revision: 1.14 $, 9,-1) -1;
ADO.pm:            'Version' => $VERSION,
ADO.pm: VERSION IS_LONG BEST_MATCH IS_FIXEDLENGTH
ExampleP.pm:    $VERSION = substr(q$Revision: 10.10 $, 9,-1) -1;
ExampleP.pm:        'Version' => $VERSION,
NullP.pm:    $VERSION = substr(q$Revision: 10.3 $, 9,-1);
NullP.pm:           'Version' => $VERSION,
Pg.pm:$DBD::Pg::VERSION = '0.93';
Pg.pm:    bootstrap DBD::Pg $VERSION;
Pg.pm:      'Version' => $VERSION,
Proxy.pm:use vars qw($VERSION $err $errstr $drh);
Proxy.pm:$VERSION = "0.2003";
Proxy.pm:           'Version' => $VERSION,
Proxy.pm:       'version'       => $DBD::Proxy::VERSION,
Sponge.pm:    $VERSION = substr(q$Revision: 10.5 $, 9,-1);
Sponge.pm:          'Version' => $VERSION,
Sponge.pm:          'Attribution' => "DBD::Sponge $VERSION (fake cursor driver) by Tim Bunce",
mysql.pm:use vars qw(@ISA $VERSION $err $errstr $drh);
mysql.pm:$VERSION = '2.0414';
mysql.pm:bootstrap DBD::mysql $VERSION;
mysql.pm:                                  'Version' => $VERSION,

Once again, eyeball the correct lines from out of here.

===

Subject: Re: Finding out ...
From: Ronald J Kimball <rjk-dbi@focalex.com>
Date: Fri, 1 Sep 2000 09:09:16 -0400

On Fri, Sep 01, 2000 at 08:13:00AM -0400, Bob Pombrio wrote:
> 
> Ok, Here is a stupid one....
> 
>   How do I find out what version of the DBI and DBD I am using?

perl -MDBI -le 'print $DBI::VERSION'
perl -MDBD::Oracle -le 'print $DBD::Oracle::VERSION'
(or whatever DBD module you're using)

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu