Subject: | viewperl broken for recent Getopt::Long |
Running the viewperl program on a simple
file of 1 line outputs the following error:
viewperl xxxx
Not a SCALAR reference at /cygdrive/f/perl/usr/bin/viewperl~ line 222.
The problem is that Getopt::Long has changed
its return values:
In version 2.37 the first argument to the callback function
was changed from string to object. This was done to make room
for extensions and more detailed control. The object
stringifies to the option name so this change should not
introduce compatibility problems.
The fix in this case is to modify the call to
GetOptions for the '<>' sub to either use $_[1]
instead of $_[0] and require Getopt::Long version
2.37 or greater, or (more compatibly) just put
"'s around the $_[0] the sub to use the stringify
feature so that the ref() at line 222 returns the
expected results.