Perl: Print Version String from Script

By Xah Lee. Date: . Last updated: .

Print version from the command line:

perl --version

Print version from within a script:

#-*- coding: utf-8 -*-
# perl

# prints version string
print $^V;                      # sample output: v5.14.2

Printing version from script is a important technique to find out which version your script is running. Because, you might have several version installed, and in terminal, there are aliases, links, path environment variables, various shell init scripts, that effect which Perl version will start when you type perl in shell.

Show Perl Version History

Type perldoc perlhist to list perl release history.

perldoc perlvar

If you have a question, put $5 at patreon and message me.


  1. Perl Overview
  2. Version String
  3. Help System


  1. Quoting String
  2. Format String
  3. String Operations
  4. True, False
  5. if then else
  6. Loop
  7. List / Array
  8. Loop Thru List
  9. Map f to List
  10. List Comprehension
  11. Hash Table
  12. Function Optional Param
  13. regex
  14. Split Line by Regex


  1. Sort List, Matrix, Object
  2. Sort Matrix
  3. List Modules, Search Paths
  4. Write a Module
  5. Read / Write File
  6. Traverse Dir
  7. Find / Replace
  8. Complex Numbers
  9. System Call
  10. Compress / Decompress gzip
  11. Get Env Var
  12. GET Web Content
  13. Unicode 🐪
  14. Convert File Encoding
  15. Sort Unstable