reliable method to find the version of perl

T

Thens

Hi,

I have a perl script that is bootstrapped by a mini shell script at
the beginning. I use

$ perl -V:version

to find the version of the perl in the environment and do some
processing based on that. I would like to know how reliable is this
method. Is this method fool proof or are there cases where this might
fail. Remember I have to find the version from the shell and not when
perl is executing.

Thanks in advance.

Regards,
Thens.
 
T

Tassilo v. Parseval

Also sprach Thens:
I have a perl script that is bootstrapped by a mini shell script at
the beginning. I use

$ perl -V:version

to find the version of the perl in the environment and do some
processing based on that. I would like to know how reliable is this
method. Is this method fool proof or are there cases where this might
fail. Remember I have to find the version from the shell and not when
perl is executing.

I wouldn't know of a case where this would fail. Another way is to
simply execute the perl in the path and have it return its version:

PERL_VERSION=`perl -e 'print $]'`

You get the version in a different format. 5.8.0 reports as 5.008 and
5.6.1 as 5.006001.

But the -V: interface exists for exactly this reason so I so no reason
not to use it.

Tassilo
 
T

Thens

Also sprach Thens:
I have a perl script that is bootstrapped by a mini shell script at
the beginning. I use

$ perl -V:version

I wouldn't know of a case where this would fail. Another way is to
simply execute the perl in the path and have it return its version:

PERL_VERSION=`perl -e 'print $]'`

You get the version in a different format. 5.8.0 reports as 5.008 and
5.6.1 as 5.006001.

But the -V: interface exists for exactly this reason so I so no reason
not to use it.

Thanks a lot.

Regards,
Thens.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,616
Members
45,306
Latest member
TeddyWeath

Latest Threads

Top