Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

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

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

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



Subject: Suggested policy: say 'x' instead of print "x\n"
If perl 5.10 is installed, then perlcritic should suggest changing print "hello\n"; to say 'hello'; One awkwardness is that 'say' is disabled in perl 5.10 unless the program has 'use 5.010'. So you might want to conditionalize the policy on that too.
Subject: Re: [rt.cpan.org #38838] Suggested policy: say 'x' instead of print "x\n"
Date: Fri, 29 Aug 2008 06:37:52 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
EDAVIS via RT wrote: Show quoted text
> If perl 5.10 is installed, then perlcritic should suggest changing > > print "hello\n"; > > to > > say 'hello'; > > One awkwardness is that 'say' is disabled in perl 5.10 unless the > program has 'use 5.010'. So you might want to conditionalize the policy > on that too.
We're well aware of the issue. In general, if say is enabled, it should be treated as identical to print in most Policies.
On Fri Aug 29 06:47:02 2008, EDAVIS wrote: Show quoted text
> If perl 5.10 is installed, then perlcritic should suggest changing > > print "hello\n"; > > to > > say 'hello';
This policy would sneak in a dependency on 5.10 (just because the code is written on 5.10 doesn't mean it must depend on it) which is why... Show quoted text
> One awkwardness is that 'say' is disabled in perl 5.10 unless the > program has 'use 5.010'. So you might want to conditionalize the policy > on that too.
...it would need that condition, where the author has already declared a 5.10 dependency. Otherwise, sounds sensible.