I have written a perl script, lets call it myscript.pl.
It has lots of modules used, and sometimes customers do not have those modules installed.
So a solution was adopted.
The software package(of which this script is a part) also provides a perl installation.
So I removed #!/usr/bin/perl from top of file, and changed use model to
$SOFTWARE_PATH/perl/bin/perl myscript.pl <option>
Now nothing stops user from doing
/usr/bin/perl myscript.pl
We don't want user to do that as the user installation may have older version of perl.
So is there a way to check from inside myscript.pl, that what was the path from where perl was invoked?
I searched google high and low, but could not find anything!
EDIT : I found it its $^X ! Went to a page with all perl special variables, theres quite a humongous list, and found this baby