Re: DBD-mysql version
Peter Pentchev <[email protected]>
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Nov 18, 2004 at 08:01:47AM +1100, Daniel Kasak wrote:
> Paul DuBois wrote:
>
> >At 0:26 +1100 11/18/04, Daniel Kasak wrote:
> >
> >>Hi all.
> >>
> >>How can I get information about the current version of DBD-mysql?
> >>I'm writing a module that needs to know this to figure out which
> >>features are available, at run-time.
> >>
> >>Dan
> >
> >
> >#! /usr/bin/perl -w
> ># dbi-version.pl - display DBI and DBD::mysql versions
> >use strict;
> >use DBI;
> >print "DBI::VERSION: $DBI::VERSION\n";
> >use DBD::mysql;
> >print "DBD::mysql::VERSION: " . $DBD::mysql::VERSION . "\n";
>
> Thanks :)
By the way, if for some reason you do not want to use/require the
DBD::mysql module (like suspecting that it might not be installed yet),
you could also try the following:
#!/usr/bin/perl -w
use strict;
use ExtUtils::Installed;
my $inst = ExtUtils::Installed->new();
my $dbiver = $inst->version("DBI");
my $mysqlver = $inst->version("DBD::mysql");
print "DBI version $dbiver\n" if $dbiver;
print "DBD::mysql version $mysqlver\n" if $mysqlver;
Note that ExtUtils::Installed does not play nice with taint mode...
G'luck,
Peter
--
Peter Pentchev [email protected] [email protected] [email protected]
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553
What would this sentence be like if pi were 3?
signature.asc
(application/pgp-signature, 187 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBnFiH7Ri2jRYZRVMRAhE2AKCnIBgablhYbOzBLhGjzqv9Z5B16wCfW89o srS5FGx+Gk1Rsc3oWFGoNCU= =2mDu -----END PGP SIGNATURE-----