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.