Example:
[PHP]bash$ cmd.pl -m "202.2.13.33 24.32.2.45" -n testing -r "2 3 4 5"[/PHP]
Options are processed by Getppts::Long. I save off @ARGV before it is processed. Unfortunately, the quotes are required because Getopts::Long in the older Perl version we use won't process multiple unquoted params per argument.
now @ARGV contains:
"-m, 202.2.13.33, 24.32.2.45, -n, testing, -r, 2, 3, 4, 5"
I need to have the exact command the user entered to start cmd.pl including the quotes around the parameters for later use so @ARGV is not very helpful here.
Does anyone have a simple trick to accomlish this? So far all I've come up with is a convoluted for loop/regex to reconstruct the string to be "correct", but the user might not have run the script correctly so I really need to stay true here.
|