Jerry Jerry - 1 year ago 51
Perl Question

how to know which perl interpreter is being used to execute current perl program

Suppose I have a script called

and looks like below:

eval 'exec perl5 -S $0 ${1+"$@"}'
if 0;

Based upon my understanding, if I run
perl foo
, the system perl will be used to execute my script (i.e.
which is specified in shebang line). However, if I run my script
then the perl interpret being used is

I want to verify my theory and I need to find a way to find out which perl interpreter is invoked to execute my script.

Is there anyway to do so?

Thanks much!

Answer Source

yes, you can find the version of perl interpreter currently script executing in, using perl special veriable. $^V

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download