Elliot Shank via RT wrote:
Show quoted text> <URL:
http://rt.cpan.org/Ticket/Display.html?id=34385 >
>
> Adam Kennedy via RT wrote:
>
>> Elliot Shank via RT wrote:
>>
>>> On this I will disagree with you. The policy does what it is
>>> supposed to. What you want is a different policy that complains
>>> about using three argument open in cases where you want to be
>>> compatible with 5.005.
>>>
>>>
>>>
>> As you mentioned, THAT policy already exists in ::More, and will
>> directly collide with the two-argument open.
>>
>> If ::More is installed, perlcritic will not allow ANY open call under
>> 5.005, since all variations trigger either the "don't use two
>> argument open" policy or "anything other than two-argument policy is
>> a bug" policy.
>>
>> You have to no-critic every single open call in code that is 5.005.
>>
>
> Modules::PerlMinimumVersion has nothing to do with open. All it cares about is a version statement.
>
Speaking as the person that wrote it, no.
P:MV looks at the version statement, yes. And THEN it scans the document
in a similar way to Perl::Critic. Except instead of scanning for policy
violations, it scans for expressions that we know require a certain
version of Perl. Things like three-value open. It collects all the
dependencies, both explicit and implicit, and reports on both the
minimum versions, and reports problems where you THOUGHT you had an
explicit dependency on 5.005, but you ACTUALLY used a language structure
that had a dependency on 5.006.
Show quoted text> *sigh*
>
> Look, there's no way that the defaults for P::C can please everyone. The defaults don't even please the P::C developers. (See t/40_perlcriticrc in the distro.)
>
> If you want a policy that complains about three argument open, I'll even write it for you.
>
That would be great. Except of course it will collide with the
two-argument open. You can't use two-argument, and you can't use three
argument.
The policies should not be blind. Otherwise why not have a policy to
prevent "use vars" for no reason at all.
All the policies were introduced for a reason. And the reason wasn't
"don't use two-argument", it was "don't use two-argument BECAUSE ...".
It's the because that is important here.
Adam K