I'm aware a script can retrieve all the command line arguments passed to it through ARGV, i.e.:
# test.pl
print "$ARGV[0]\n";
print "$ARGV[1]\n";
print "$ARGV[2]\n";
## perl ./test.pl one two three
one
two
three
In the above example, the command line arguments passed to the test.pl script are "one", "two" and "three".
Now, suppose I run the following command:
## perl -d:DumpTrace test.pl one two three
or
## perl -c test.pl one two three
How can I tell from within the operations of the test.pl script that the options -c or -d:DumpTrace were passed to the perl interpreter?
I'm looking for a method that will identify when options are passed to the perl interpreter during the execution of a script:
if "-c" was used in the execution of `test.pl` script {
print "perl -c option was used in the execution of this script";
}