Skip Menu |

This queue is for tickets about the Perl-Critic-Pulp CPAN distribution.

Report information
The Basics
Id: 131961
Status: open
Priority: 0/
Queue: Perl-Critic-Pulp

People
Owner: Nobody in particular
Requestors: HMBRAND [...] cpan.org
Cc:
AdminCc:

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



Subject: Compatibility::PerlMinimumVersionAndWhy gets confused inside format
See also https://github.com/Perl-Critic/Perl-Critic/issues/788 --8<--- ``` perl #!/usr/bin/perl use strict; use warnings; our $VERSION = "0.00"; format STDOUT = Header @<<< $a =========== text @<<<<< $_ ----------- . write; ``` ``` sh $ perlcritic -1 test.pl test.pl#9.1: [4 - Freenode::DollarAB] Using $a or $b outside sort() :$a test.pl#13.1: [2 - Compatibility::PerlMinimumVersionAndWhy] _Pulp__5010_stacked_filetest requires 5.010 :----------- -->8--- Err, no, that is not a range of operators
Subject: Re: [rt.cpan.org #131961] Compatibility::PerlMinimumVersionAndWhy gets confused inside format
Date: Wed, 26 Feb 2020 12:14:32 +1100
To: "H.Merijn Brand via RT" <bug-Perl-Critic-Pulp [...] rt.cpan.org>
From: Kevin Ryde <user42_kevin [...] yahoo.com.au>
"H.Merijn Brand via RT" <bug-Perl-Critic-Pulp@rt.cpan.org> writes: Show quoted text
> > format STDOUT = > ...
Alas PPI (as of its Debian packaged version 1.270 for me) doesn't seem to understand "format". Its parse gives a lot of operators for what is supposed to be the format text. In this case they tickle one of my tests, but it's going to be mild to moderate havoc in general. You can see the PPI parse with tools/ppidump from perlcritic (/usr/share/doc/libperl-critic-perl/examples/ppidump) ppidump test.pl => ... [ 13, 11, 11 ] PPI::Token::Operator '-' Dunno whether format is on the todo list for PPI. You'd imagine something basic grabbing the text part ought to be feasible (even if eventually you'd like to know things like what variables are interpolated where).