On Fri, Sep 30, 2011 at 05:34:46PM +0000, Lubos Kolouch wrote:

> Hello again,
> 
> So it seems perlcritic is perhaps right - when I swap the lines 
> my @array; and open ..., it does not complain anymore.
> 
> So I guess it is in facts correct behaviour of perlcritic :)

Something about this didn't smell right to me, so I have investigated
further.

The policy of which you are running afoul is InputOutput::RequireBriefOpen.
It seems that all this policy is checking is that your close() comes within
a certain number of lines of your open(), the default being 9.  This is the
reason you didn't get a criticism when you deleted the say(), or when you
changed the order of the lines.  You could equally as well have deleted one
of the blank lines.

I see little value in this policy, but that applies to a number of other
policies and, as I mentioned, i don't use perlcritic anyway.  If you want
to keep using this policy then I suppose you should either adhere to it, or
tweak the configuration until you are happy with it.

-- 
Paul Johnson - p...@pjcj.net
http://www.pjcj.net

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to