I am attempting to log behavior in my Perl script. I would like to print all arguments that are passed to Getopt::Long's GetOptions
but @ARGV
is empty.
I would like something that would automatically print all options and their values that were passed to GetOptions
. I have been reading https://perldoc.perl.org/Getopt/Long.html but I can't find anything there.
What I want is very simple, I'm surprised that I can't find anything like this. How can I automatically output all options and their settings for logging purposes?
If you want the value of a variable before it gets changed, you make a copy of the value of the variable before it gets changed.
my @orig_ARGV = @ARGV;