Hi,
Check out
The Dynamic Duo --or-- Holy Getopt::Long, Pod::UsageMan! on how to use
Getopt::Long with
Pod::Usage. This should will cover the case of the POD (the user doc) matching the the usage sub, as the text will be derived from the same point, the POD.
The one thing it won't cover is the comments:
our $debug = 0; # switch on debuging
our $verbose = 0; # important info to STDOUT
my $help = 0; # show usage
my $force = 0; # run even if less than 5 since last run
....
However, as has been discussed in multiple places in the Monastery, the choice of variable names (self-commenting) is much more important than the comments after the variable declarations. All of your variable names seem to be self-documenting, so I'm not sure it's necessary to have such detailed comments after their declarations. I would maintain that having POD, usage and self-documenting variables is the way to go here.
- j