Subject: | strict refs error |
Date: | Sun, 5 Jul 2015 19:56:03 +0100 |
To: | bug-Parse-Yapp [...] rt.cpan.org |
From: | mikey <abc.mikey [...] gmail.com> |
Hi,
I'm trying out Parse::Yapp with a tutorial from here:
http://perl.find-info.ru/perl/025/advperl2-chp-2-sect-2.html
And I get the following error with the latest from cpan:
Can't use string ("") as an ARRAY ref while "strict refs" in use at
/home/michael/perl5/lib/perl5/Parse/Yapp/Grammar.pm line 193.
A naive fix, based on no more investigation than the error message, that
appears to work is:
--- /home/michael/perl5/lib/perl5/Parse/Yapp/Grammar.pm 2015-07-05
19:51:45.096661701 +0100
+++ /home/michael/perl5/lib/perl5/Parse/Yapp/Grammar.pm.new 2015-07-05
19:51:31.010770363 +0100
@@ -190,7 +190,7 @@
my($linenums)=$self->Option('linenumbers');
my($text);
- $$self{GRAMMAR}{TAIL}[0]
+ (ref $$self{GRAMMAR}{TAIL} eq 'ARRAY' and $$self{GRAMMAR}{TAIL}[0])
or return '';
defined($inputfile)