Howto get Perl Informix DBI version number Pls
Posted in 2007
Topics: General Discussion
Hi all; How do I get the Informix::DBI version number from Perl? `What perl` reveals nothing of value and grepping the perl subdir's shows little. There must be a one liner you guys use? Iam on amongst other things HPux 11.00 / Perl 5.6.1. I suspect that perl has the Informix DBI embedded in it or am I thinking of Apache! Regards Ian
ian wrote: > How do I get the Informix::DBI version number from Perl? IF you have Active Perl - it comes with ppm which can be asked for information on installed package(s). On my Windows I can: C:\\>ppm query DBI Querying target 1 (ActivePerl 5.8.8.817) 1. DBI [1.50] Database independent interface for Perl C:\\>ppm query DBD Querying target 1 (ActivePerl 5.8.8.817) 1. DBD-DB2 [0.78] Perl driver for IBM DB2 Universal Database Jan M. Nelken
ian wrote:
> How do I get the Informix::DBI version number from Perl?
>
> `What perl` reveals nothing of value and grepping the perl subdir's
> shows little.
>
> There must be a one liner you guys use?
>
> Iam on amongst other things HPux 11.00 / Perl 5.6.1.
>
> I suspect that perl has the Informix DBI embedded in it or am I
> thinking of Apache!
There are two parts to solving this:-
1) Identify the module you are interested in accurately:
DBI
DBD::Informix
2) Know the magic ways of getting Perl to identify module versions:
perl -MDBI -e 'print "$DBI::VERSION\\n";'
perl -MDBD::Informix -e 'print "$DBD::Informix::VERSION\\n";'
perl -MDBD::Informix=9999
perl -MDBI=9999
The first two are straight-forward - load the module you are after, and
then print its VERSION value. The last two illustrates TMTOWTDI
(pronounced tim-toady - There's More Than One Way To Do It). For
example, with the DBI line, I get:
$ perl -MDBI=9999DBI version 9999 required--this is only version 1.54 at
/Users/jleffler/perl/v5.8.8/lib/5.8.8/Exporter/Heavy.pm line 121.
BEGIN failed--compilation aborted.
$
There are, undoubtedly, other mechanisms, but these are adequate for
most people most of the time.
(It is at best debatable whether the Perl has any module embedded in it,
in general. On HP-UX, I suppose it is possible that someone built a
version of Perl with DBI and DBD::Informix statically linked into it,
but that is pretty unlikely. The techniques above work regardless.)
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/