How do I check which version of Perl is Apache2 using? I have a few versions of Perl installed and I want to make sure.

link|improve this question

50% accept rate
feedback

3 Answers

up vote 5 down vote accepted

perldoc perlvar

$^V contains the version.

perl -le 'print $^V'

link|improve this answer
1  
On the command line, simply ask 'perl -v' – Yaakov Belch Nov 3 '09 at 12:35
I used the command line only to show sample usage. The contents of $^V is the most trustworthy way of knowing what you're really working with. – Zimmy-DUB-Zongy-Zong-DUBBY Jan 28 '10 at 20:28
feedback

Shouldn't this depend on what your actual scripts have for the shebang line? perl -V I believe would report what perl version the 'perl' command is set up for, but it depends on which one you specify in your scripts.

Are you using mod_perl? .cgi files? How exactly are you using the perl files in Apache?

link|improve this answer
feedback

There should be an entry in the Server header sent by your Apache installation to all clients. You can easily check this with a netcat session or an online tool.

For example, our server returns

Server: Apache/2.2.9 (Debian) ... mod_perl/2.0.4 Perl/v5.10.0

(This may require mod_perl, I'm not certain.)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.