http://www.perlmonks.org?node_id=1022100

mpersico has asked for the wisdom of the Perl Monks concerning the following question:

In a perl script, is there anyway to determine the following:

1) Was the script started via 'perl script.pl' or 'script.pl' using the she-bang line?

2) Can I determine what options were passed to 'perl' for the former or what options were on the she-bang line for the latter?

The reason is that I am looking at the Restart functionality of the Devel::ptkdb debugger and the restart is hardcoded as perl -d:ptkdb -w originalScript originalArgs

If any other options were given to perl (-a, -n -e, etc) then the restart will be different than the original call.

Thanks!