$ cat fred.pl #!/usr/bin/env perl use Cwd qw{abs_path}; print "Perl executing the script: ", `which $^X`; print "Script being executed: ", abs_path($0), "\n"; print "PID: $$\n";