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.


perldoc perlvar

$^V contains the version.

perl -le 'print $^V'

  • 1
    On the command line, simply ask 'perl -v' 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. Jan 28 '10 at 20:28

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?


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.)

  • The perl version reference is indeed only shown when using mod_perl.
    – cjoy
    May 8 '15 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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