Skip Menu |

This queue is for tickets about the Parse-RecDescent CPAN distribution.

Report information
The Basics
Id: 4898
Status: resolved
Priority: 0/
Queue: Parse-RecDescent

People
Owner: Nobody in particular
Requestors: mezam [...] mezami.qc.ca
Cc:
AdminCc:

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



Subject: new can not fail silently
use Parse::RecDescent; undef $::RD_ERRORS; undef $::RD_WARN; undef $::RD_HINT; new Parse::RecDescent("asdffa" ); Even whith globals set for not reporting problems, errors and hints, a bad grammar still print this hint: (Hint: Set $::RD_HINT (or -RD_HINT if you're using "perl -s") for hints on fixing these problems.) This patch only print the hint about RD_HINT when RD_ERRORS is not set. The default comportement will not change because RD_ERRORS is set by default. --- lib/Parse/RecDescent.pm (revision 2) +++ lib/Parse/RecDescent.pm (working copy) @@ -2621,11 +2621,11 @@ $@ =~ s/at grammar/in grammar at/; _hint($@); } } - if ($ERRORS and !_verbosity("HINT")) + if ($ERRORS and !_verbosity("HINT") and _verbosity("ERRORS")) { local $::RD_HINT = 1; _hint('Set $::RD_HINT (or -RD_HINT if you\'re using "perl -s") for hints on fixing these problems.'); }
--- lib/Parse/RecDescent.pm (revision 2) +++ lib/Parse/RecDescent.pm (working copy) @@ -2621,11 +2621,11 @@ $@ =~ s/at grammar/in grammar at/; _hint($@); } } - if ($ERRORS and !_verbosity("HINT")) + if ($ERRORS and !_verbosity("HINT") and _verbosity("ERRORS")) { local $::RD_HINT = 1; _hint('Set $::RD_HINT (or -RD_HINT if you\'re using "perl -s") for hints on fixing these problems.'); }
Date: Mon, 26 Jan 2004 15:28:53 +1100
From: Damian Conway <damian [...] conway.org>
To: bug-Parse-RecDescent [...] rt.cpan.org
Subject: Re: [cpan #4898] new can not fail silently
RT-Send-Cc:
Guest via RT wrote: Show quoted text
> This message about Parse-RecDescent was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=4898 > > > use Parse::RecDescent; > > undef $::RD_ERRORS; > undef $::RD_WARN; > undef $::RD_HINT; > > new Parse::RecDescent("asdffa" ); > > > Even whith globals set for not reporting problems, errors and hints, a bad grammar still print this hint: > > (Hint: Set $::RD_HINT (or -RD_HINT if you're using "perl -s") > for hints on fixing these problems.) > > > This patch only print the hint about RD_HINT when RD_ERRORS is not set. The default comportement will not change because RD_ERRORS is set by default. > > > --- lib/Parse/RecDescent.pm (revision 2) > +++ lib/Parse/RecDescent.pm (working copy) > @@ -2621,11 +2621,11 @@ > $@ =~ s/at grammar/in grammar at/; > _hint($@); > } > } > > - if ($ERRORS and !_verbosity("HINT")) > + if ($ERRORS and !_verbosity("HINT") and _verbosity("ERRORS")) > { > local $::RD_HINT = 1; > _hint('Set $::RD_HINT (or -RD_HINT if you\'re using "perl -s") > for hints on fixing these problems.'); > }
Actually, I changed the hinting behaviour instead. So now you can say: $::RD_HINT = 0; to explicitly turn off all hinting, including automatic hints. Thanks for the bug report, Damian
Thank you for the bug report! In addition to the behavior Damian added previously, I've added the following text to the "default" $::RD_HINT message ($::RD_HINT undefined): Use $::RD_HINT = 0 to disable this message. You can see the change here: https://github.com/jtbraun/Parse-RecDescent/commit/c5fcc7c3052058be1370fab7541379b9acf014a5 It will be a part of the next release.