perlancar / perl-Getopt-Long-More

1 stars 1 forks source link

Fix #9 - Avoid hijacking GoL legacy default dests #10

Closed tabulon closed 5 years ago

tabulon commented 5 years ago

This PR resolves #9 - [Avoid hijacking GoL legacy default dests].

It was much easier than initially feared: 2 lines :-)

Because, as turns out, there was an existing GoL mechanism ($Getopt::Long::caller).


In addition to the resolving #9, this change should also benefit:


Afaics, the only potential concern with the approach taken by this change is the word "invisible" below :


package Getopt::Long;
...
# Official invisible variables.
use vars qw($genprefix $caller $gnu_compat $auto_help $auto_version $longprefix);
...

But in any case, GLM already makes use of at least two other invisible variables in there ( $auto_help and $auto_version), why not another? -- especially if it is marked "# Official", right? :-)