Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

perl module version checking

0 views
Skip to first unread message

Anirban Adhikary

unread,
Jul 10, 2008, 1:19:31 AM7/10/08
to begi...@perl.org
Dear List
Can U please tell me how to check the version of any installed module in
perl. If I want to check the version of version of DBI module then what is
the syntax for it?

Thanks & Regards in advance
Anirban Adhikary

Octavian Rasnita

unread,
Jul 10, 2008, 1:32:37 AM7/10/08
to Anirban Adhikary, begi...@perl.org
From: "Anirban Adhikary" <anirban....@gmail.com>> Dear List

You can do:

perl -MDBI -e "print $DBI::VERSION;"

or shorter:

perl -M"DBI 999" -e1

which will give an error telling that this is a lower version of DBI than the one requested and it will also give the version.

If you do it under Unix/Linux, use ' instead of ".

Octavian

Anirban Adhikary

unread,
Jul 10, 2008, 2:25:14 AM7/10/08
to begi...@perl.org
Hi
Can u please tell me where i need to use ' instead of " and what will be the
syntax of that string. Because when I am using perl -MDBI -e "print
$DBI::VERSION;" on my linux system I am not getting any output but the
second option is working fine.

Thanks & Regards in advance

Anirban Adhikary.

Anirban Adhikary

unread,
Jul 10, 2008, 2:29:59 AM7/10/08
to begi...@perl.org, oras...@gmail.com
Hi
I am very very sorry for questioning like an idiot. Please forgive me for
such a silly question.

Thanks & Regards in advance
Anirban Adhikary.

Laxminarayan Kamath

unread,
Jul 10, 2008, 2:41:50 AM7/10/08
to Anirban Adhikary, begi...@perl.org
On Thu, July 10, 2008 11:55 am, Anirban Adhikary wrote:
> Hi
> Can u please tell me where i need to use ' instead of " and what will
> be the
> syntax of that string. Because when I am using perl -MDBI -e "print
> $DBI::VERSION;" on my linux system I am not getting any output but the
> second option is working fine.


When you put a string between ''s , no kind of shell variable expansion
is done. The string is passed exactly as it is. Where as text inside
"" are subject to different kinds of expansions/replacements, etc..

So for your particular case.. I guess you need
perl -MDBI -e 'print $DBI::VERSION;'

becasue if you write


perl -MDBI -e "print $DBI::VERSION;"

it will interpret $DBI as a shell variable. If I am not wrong, $DBI is
empty in your shell. And thus your command becomes
perl -MDBI -e 'print ::VERSION;'
before it gets called.


--
Laxminarayan G Kamath A
http://lankerisms.blogspot.com
http://kamathln.homelinux.net (avail if my laptop is online)


0 new messages