Howto find out perl version
Q. How do I find out Perl version by running a cgi script from a webbrowser? How do I find out perl version from a command prompt under Windows or Linux / UNIX operating systems?
A. Perl is acronym for Practical Extraction and Report Language. It is a general-purpose programming language invented in 1987 by Larry Wall. Originally developed for text manipulation. Perl has become extremely popular and is now used for a wide range of tasks, including web development and interface design.
Find perl version from a shell prompt
If you have access to a shell prompt (UNIX/Linux) type following command to find out perl version:
$ perl -v
You can also type above command under Windows / Mac OS X by opening terminal.
Find perl version using a cgi script
If your web hosting server provider don't provide access to a shell, use following perl program to find out perl version:
Short version that avoid starting a new process (see below in comments):
#!/usr/bin/perl $command= $]; $title = "Perl Version"; print "Content-type: text/html\n\n"; print "<html><head><title>$title</title></head><body>"; print " <h1>$title</h1> \n"; print "Perl version : ".$command;
source code - version.pl (download link)
The following code provides a little bit more information:
#!/usr/bin/perl $command=`perl -v`; $title = "Perl Version"; print "Content-type: text/html\\n\\n"; print "<html><head><title>$title</title></head><body>"; print " <h1>$title</h1> \n"; print $command; print "</body></html>";
Upload script to your cgi-bin directory and execute script by typing url http://mydomain.com/cgi-bin/version.pl
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Linux: Find my IP address using Perl at a shell prompt
- How do I install a Perl Module?
- How do I find out syntax errors in my Apache web server configuration file?
- FreeBSD install Perl language
- How do I find out what perl modules already installed on my system?
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: check perl version, find perl version, find perl version on solaris, find version of perl, finding perl version, get perl version, how to find perl version, how to find what version of perl, perl check version, perl version command



March 17th, 2008 at 12:42 pm
It is overkill to run a whole new process to find out the version, just read about Perl’s builtin variables in PERLVAR
In the code above change
$command=`perl -v`;
to
$command= $]