Skip Menu |

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

Report information
The Basics
Id: 107662
Status: resolved
Priority: 0/
Queue: Getopt-Lazy

People
Owner: RUEYCHENG [...] cpan.org
Requestors: gsullivan [...] cpan.org
Cc:
AdminCc:

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



Subject: SYNOPSIS strict compile error
The code in the SYNOPSIS section of the POD does not compile with "use strict", and it generates warning messages with "use warnings". $ cat foo.pl use Getopt::Lazy 'help|h' => 'Show this help screen', 'verbose|v' => 'Show verbose output', 'output|o=s' => ["[FILE] Send the output to FILE", 'getopt.out'], 'output-encoding=s' => ['[ENCODING] Specify the output encoding', 'utf8'], -summary => 'a simple example usage of Getopt::Lazy', -usage => '%c %o file1 [file2 ..]', ; getopt; print usage and exit 1 unless @ARGV; $ perl -Mstrict foo.pl Bareword "getopt" not allowed while "strict subs" in use at foo.pl line 10. Execution of foo.pl aborted due to compilation errors. $ perl -w foo.pl Unquoted string "getopt" may clash with future reserved word at foo.pl line 10. Unquoted string "usage" may clash with future reserved word at foo.pl line 11. Useless use of a constant ("getopt") in void context at foo.pl line 10. Name "main::usage" used only once: possible typo at foo.pl line 11. print() on unopened filehandle usage at foo.pl line 11. $ Please update the POD with code that runs with strict and warnings.
Hi, I'm really surprised that someone is still using this module after all these years. This module is more like a hack rather than a practical solution, so use it at your own risk. :) I just uploaded version 0.0.7. Have a try later and see if that solves your problem. Cheers, RC On Fri Oct 09 10:07:07 2015, GSULLIVAN wrote: Show quoted text
> The code in the SYNOPSIS section of the POD does not compile with > "use strict", and it generates warning messages with "use warnings". > > $ cat foo.pl > use Getopt::Lazy > 'help|h' => 'Show this help screen', > 'verbose|v' => 'Show verbose output', > 'output|o=s' => ["[FILE] Send the output to FILE", 'getopt.out'], > 'output-encoding=s' => ['[ENCODING] Specify the output encoding', > 'utf8'], > -summary => 'a simple example usage of Getopt::Lazy', > -usage => '%c %o file1 [file2 ..]', > ; > > getopt; > print usage and exit 1 unless @ARGV; > $ perl -Mstrict foo.pl > Bareword "getopt" not allowed while "strict subs" in use at foo.pl > line 10. > Execution of foo.pl aborted due to compilation errors. > $ perl -w foo.pl > Unquoted string "getopt" may clash with future reserved word at foo.pl > line 10. > Unquoted string "usage" may clash with future reserved word at foo.pl > line 11. > Useless use of a constant ("getopt") in void context at foo.pl line > 10. > Name "main::usage" used only once: possible typo at foo.pl line 11. > print() on unopened filehandle usage at foo.pl line 11. > $ > > Please update the POD with code that runs with strict and warnings.
Confirmed fixed in version 0.0.7.