finding version number of a library

finding version number of a library

am 10.08.2007 12:54:35 von Nick Wedd

I know it is normal in this newsgroup to sneer at anyone who asks a
question that they don't already know the answer to. But I'll give it a
shot anyway.

When my code says
use GD;
it works. My guess is that my web host has installed a copy of the GD
module. How can I find its version number?

Nick
--
Nick Wedd nick@maproom.co.uk

Re: finding version number of a library

am 10.08.2007 13:23:27 von paduille.4061.mumia.w+nospam

On 08/10/2007 05:54 AM, Nick Wedd wrote:
> I know it is normal in this newsgroup to sneer at anyone who asks a
> question that they don't already know the answer to. But I'll give it a
> shot anyway.
>
> When my code says
> use GD;
> it works. My guess is that my web host has installed a copy of the GD
> module. How can I find its version number?
>
> Nick

print $GD::VERSION;

Re: finding version number of a library

am 10.08.2007 13:26:58 von Sherm Pendley

Nick Wedd writes:

> I know it is normal in this newsgroup to sneer at anyone who asks a
> question that they don't already know the answer to.

Is it "normal" for you to introduce yourself by insulting people you've
just met?

> But I'll give it a shot anyway.

Gee, how generous of you.

> When my code says
> use GD;
> it works. My guess is that my web host has installed a copy of the GD
> module. How can I find its version number?

I'd answer you, but I'm too busy sneering at newbies.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: finding version number of a library

am 10.08.2007 13:43:29 von Sisyphus

"Nick Wedd" wrote in message
news:SNcmYo4rPEvGFAIY@maproom.demon.co.uk...

>I know it is normal in this newsgroup to sneer at anyone who asks a
>question that they don't already know the answer to.

In all seriousness, I believe that's the way it is in *some* newsgroups ...
but not to *this* one.

Cheers,
Rob

Re: finding version number of a library

am 10.08.2007 13:43:49 von Nick Wedd

In message , Sherm Pendley
writes
>Nick Wedd writes:
>
>> I know it is normal in this newsgroup to sneer at anyone who asks a
>> question that they don't already know the answer to.
>
>Is it "normal" for you to introduce yourself by insulting people you've
>just met?

I haven't just met them. I've been watching them for a good while, as
recommended in the advice on posting here.

Nick

>> But I'll give it a shot anyway.
>
>Gee, how generous of you.
>
>> When my code says
>> use GD;
>> it works. My guess is that my web host has installed a copy of the GD
>> module. How can I find its version number?
>
>I'd answer you, but I'm too busy sneering at newbies.
>
>sherm--
>

--
Nick Wedd nick@maproom.co.uk

Re: finding version number of a library

am 10.08.2007 14:12:25 von Sisyphus

"Nick Wedd" wrote in message
news:2tbvgx519EvGFAOJ@maproom.demon.co.uk...
..
..
>>Is it "normal" for you to introduce yourself by insulting people you've
>>just met?
>
> I haven't just met them. I've been watching them for a good while, as
> recommended in the advice on posting here.
>

Pity you didn't take note of the advice pertaining to the trimming of
replies.

Cheers,
Rob

Re: finding version number of a library

am 10.08.2007 14:25:29 von Sherm Pendley

Nick Wedd writes:

> In message , Sherm Pendley
> writes
>>Nick Wedd writes:
>>
>>> I know it is normal in this newsgroup to sneer at anyone who asks a
>>> question that they don't already know the answer to.
>>
>>Is it "normal" for you to introduce yourself by insulting people you've
>>just met?
>
> I haven't just met them. I've been watching them for a good while

Maybe so, but we've just met you - and you've introduced yourself to us by
saying "I know you people are normally quite rude, but I hope you'll make
an exception for me."

We live by the rule here, that it's better to teach someone to fish than to
give him a fish. Some newbies expect free fish, and like to imagine they've
been sneered at when they get a free fishing lesson instead.

You "know" far less about these Perl groups than you think you do.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: finding version number of a library

am 10.08.2007 16:07:17 von RedGrittyBrick

Nick Wedd wrote:
> I know it is normal in this newsgroup to sneer at anyone who asks a
> question that they don't already know the answer to.

You're wrong, I often ask such questions and don't recall getting
sneered at normally. What you fear might be better expressed as:

It is commonplace in this newsgroup to express exasperation at anyone
who asks a question that can be *easily* answered from well-known
sources such as the Perl documentation, the newsgroup FAQ or Google.

You can often avoid such responses by introducing your question with a
short description of what you've tried. For example: "I've read 'perldoc
perlmod' and googled for 'perl module version' but not found how to ..."

The very act of composing such a sentence usually makes me double check
those sources - from which I often find something I overlooked.

> But I'll give it a shot anyway.

I find this newsgroup works well so long as you are not particularyly
thin-skinned nor have an overly inflated sense of your own infallibility :-)


> When my code says
> use GD;
> it works. My guess is that my web host has installed a copy of the GD
> module. How can I find its version number?

I think the `print $::VERSION` idiom ought to work with any
module from CPAN.

Re: finding version number of a library

am 15.08.2007 22:09:52 von Charles DeRykus

On Aug 10, 3:54 am, Nick Wedd wrote:
> I know it is normal in this newsgroup to sneer at anyone who asks a
> question that they don't already know the answer to. But I'll give it a
> shot anyway.
>
> When my code says
> use GD;
> it works. My guess is that my web host has installed a copy of the GD
> module. How can I find its version number?
>

one other option is to request a humongously
version number (perldoc -f use) :


$ perl -e "use GD 9999"
GD version 9999 required--this is only version 2.35 at -e line 1.

--
Charles DeRykus

Re: finding version number of a library

am 16.08.2007 09:45:22 von Dan Otterburn

On Aug 15, 9:09 pm, "comp.llang.perl.moderated" sam-01.ca.boeing.com> wrote:

> one other option is to request a humongously
> version number (perldoc -f use) :
>
> $ perl -e "use GD 9999"
> GD version 9999 required--this is only version 2.35 at -e line 1.

Just don't try this for File::Slurp, which is at version 9999.12! (I
don't know if there are any other CPAN modules with falsely inflated
version numbers above 9999?)

Re: finding version number of a library

am 16.08.2007 18:57:58 von Charles DeRykus

On Aug 16, 12:45 am, Dan Otterburn wrote:
> On Aug 15, 9:09 pm, "comp.llang.perl.moderated" >
> sam-01.ca.boeing.com> wrote:
> > one other option is to request a humongously
> > version number (perldoc -f use) :
>
> > $ perl -e "use GD 9999"
> > GD version 9999 required--this is only version 2.35 at -e line 1.
>
> Just don't try this for File::Slurp, which is at version 9999.12! (I
> don't know if there are any other CPAN modules with falsely inflated
> version numbers above 9999?)

No, if there's no error message, then you know
it's a "Slurp-y" style so you just bump the
version a couple more 9's.

Even with a rare, add-on edit, this's
easier than $MODULE_NAME::VERSION...

--
Charles DeRykus

Re: finding version number of a library

am 17.08.2007 02:18:44 von Michael Carman

On 8/10/2007 5:54 AM, Nick Wedd wrote:
>
> When my code says
> use GD;
> it works. My guess is that my web host has installed a copy of the GD
> module. How can I find its version number?

Standard Perl practice is to define a $VERSION variable for each module
(although nothing forces authors to do so). So C<$GD::VERSION> should hold the
version.

Normally the only reason you care about this is if your code depends on a
certain (minimum) version, in which case you should specify it in the 'use'
statement. e.g.

use GD 2.10;

-mjc