In Perl or Python, you can print the version of the interpreter from the command line. ⁖
perl --version,
python --version.
However, often you have several versions installed, and you wanted to know which version your script is actually running from. On the command line, there are aliases, links, path environment variables, various shell init scripts (.rc, .profile, .profile, .bash_profile), and it is often complex to find out the exact steps which version your script would be running from.
One absolutely accurate way to know is simply have your script print the version string within. This is most useful when you work on a new machine or server.
#-*- coding: utf-8 -*- # python import sys print sys.version # 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
http://docs.python.org/library/sys.html
# -*- coding: utf-8 -*- # Ruby # print Ruby version from within Ruby script p RUBY_VERSION # "1.9.3"
#-*- coding: utf-8 -*- # perl # prints version string print $^V; # sample output: v5.14.2blog comments powered by Disqus