Which version of perl is installed on my system?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Which version of perl is installed on my system?
# 1  
Old 04-20-2005
Which version of perl is installed on my system?

Hi,
With the command perl -v i can see the perl version, but it's like a text file..
is there a command which could give me just the perl version number?
i.e.: "5.8.1"

thanks!!
# 2  
Old 04-20-2005
What do you mean "like a text file"? perl -v outputs the version information for the perl that is installed. Output is to stdout. You can capture and parse this data to get the version number if you wish. Post the output of perl -v from your machine.
# 3  
Old 04-20-2005
i wanted to know if there was a way to get te version number without parsing.. i didn't want to do that work

thanks anyways!!
# 4  
Old 04-20-2005
There may be a way but I do not know it off hand. Check the perl man pages or have a look around CPAN or have a look here Perl FAQ
# 5  
Old 04-20-2005
Probably the best way to get the perl version, is with perl itself.

Perl script:

Code:
use strict;

$::VERSION = join('.', map {ord} split('', $^V)); 
print $::VERSION

Or as a single command to run in your favourite shell:
Code:
perl -Mstrict -wall -e "print join('.', map {ord} split('', \$^V));"

Output (on my system):

5.8.1

See the perlvar man page (for $^V) for further treatment of the subject.

Last edited by cbkihong; 04-20-2005 at 09:46 PM.. Reason: Minor improvements
# 6  
Old 04-20-2005
the OP might be looking for perl options like in "uname -r" to get the OS version ... anyways, here's my 2 cents ...
Code:
perl -v | awk '/This/ {print $4}' | sed -e 's/v//'


Last edited by Just Ice; 04-20-2005 at 10:08 PM.. Reason: remove the "v"
This User Gave Thanks to Just Ice For This Post:
# 7  
Old 04-20-2005
Thanks to all of you!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash find version of an installed application but if none is found set variable to App Not Installed

Hello Forum, I'm issuing a one line bash command to look for the version of an installed application and saving the result to a variable like so: APP=application --version But if the application is not installed I want to return to my variable that the Application is not installed. So I'm... (2 Replies)
Discussion started by: greavette
2 Replies

2. Solaris

Check that supersede of package version is installed

I need a programmatic way to check, that supersede of required package is installed. At Linux I do it using rpmvercm utility to compare installed package version to my minimal requirement. So - I need analog of Linux "rpmvercm" utility for Solaris (10/11) Let us say - I know that minimal version... (10 Replies)
Discussion started by: zuismanm
10 Replies

3. Shell Programming and Scripting

Portable Shell Script - Determine Which Version of Binary is Installed?

I currently have a shell script that utilizes the "Date" binary - this application is slightly different on OS X (BSD General Commmand) and Linux systems (gnu date). In particular, the version on OS X requires the following to get a date 14 days in the future "date -v+14d -u +%Y-%m-%d" where gnu... (1 Reply)
Discussion started by: colinjohnson
1 Replies

4. Shell Programming and Scripting

installed java version ?

Hi, I want to know what version of the java is installed? Please let me know the command or process to identify the installed java version in sun solaris box. Thanks in advance for all your support. (3 Replies)
Discussion started by: sridhardwh
3 Replies

5. UNIX for Advanced & Expert Users

perl and HP-UX : instmodsh in combination with software depot : update inventory for installed Perl

we create a HP-UX software depot with a new perl-modul. after installation of the software depot, the perl module i can't find with instmodsh in the inventory for installed Perl modules. - i have learned of using instmodsh command : i find out what modules are already installed on my system. ... (0 Replies)
Discussion started by: bora99
0 Replies

6. UNIX for Dummies Questions & Answers

What would take the Place of X Window System if X was not installed?

If X was not installed, what would print data onto the display? Does it include applications form Gpl/Gnu or is it a daemon only? Thanks in advance!:wall: (2 Replies)
Discussion started by: theKbStockpiler
2 Replies

7. Red Hat

How to verify the current NIC driver version installed in RHEL5.3??

Guys, Can you help me how to verify the current installed NIC driver version in RHEL5.3? Thanks.:D (1 Reply)
Discussion started by: shtobias
1 Replies

8. Shell Programming and Scripting

newer version of the parser installed,yet get the older one itlself,hows it possible?

Hi all, I downloaded a XML parser lib from blastwave.org... Its the "libxml2",but i am having trouble initializing it(or so it feels)...I kind of need it badly as the OSE version of the virtualbox 1.6.2 will not install unless i have one The version was 2.6.3... The min requirement from... (0 Replies)
Discussion started by: wrapster
0 Replies

9. Solaris

Setting link to newly installed Java version

Hi, I have Solaris 8 wih Java 1.2.2 as default. I just upgraded it to Java 2 version 1.4. But when I do "java -version: I get following: "Java version "1.2.2" Solaris VM (build Solaris_JDK_1.2.2_05a, native threads, sunjwit) How would I make solaris to look at my new java? If I have to... (4 Replies)
Discussion started by: harjitsingh
4 Replies

10. UNIX for Advanced & Expert Users

How to Find the OS version Installed

Hi, I wanted to know how can I get the version of underlying HP-OS installed on a HPUX workstation. The output required is "June 2001" version or "March 2003" version etc whatever OS is present. Thanx in advance for your help. Regards, Pankaj (3 Replies)
Discussion started by: pankschawla
3 Replies
Login or Register to Ask a Question