Skip Menu |

This queue is for tickets about the Getopt-Long CPAN distribution.

Report information
The Basics
Id: 132513
Status: rejected
Priority: 0/
Queue: Getopt-Long

People
Owner: jv [...] cpan.org
Requestors: SVW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: auto_version: Why is $VERSION bound to "main" package instead of calling package.
Getopt::Long 2.51 I wanted to use the auto_version configuration option of Getopt::Long in my application. I am unable to do this because my application refers to a package that is different from the default package "main". Could this be changed? I don't understand why auto_version doesn't refer to the $VERSION var of the calling package. A second point that is arguable is the fact that auto_version prints the versions of Getopt::Long and Perl too. For a non-perl enduser this extra information is pure noise.
Auto-version is a (very little used) feature to quickly get some relevant version information. The choice to use $main::VERSION is deliberate, since application programs are usually 'main'. If you would like a customized message it is better to supply your own VersionMessage routine.
Am Mi 06. Mai 2020, 07:22:29, JV schrieb: Show quoted text
> Auto-version is a (very little used) feature to quickly get some > relevant version information. The choice to use $main::VERSION is > deliberate, since application programs are usually 'main'. > > If you would like a customized message it is better to supply your own > VersionMessage routine.
I don't want to implement my own customized message because it feels to me like reinventing the wheel. Instead I would recommend that the auto_version configuration option tries to come close to this recommendation https://www.gnu.org/prep/standards/html_node/_002d_002dversion.html I agree that most application programs use the default namespace 'main' but if you implement your application as a modulino this usually is not the case. Making the auto_version configuration option always to use the calling package would be a backwards compatible change.
Rejected due to lack of interest.