develooper Front page | perl.perl5.porters | Postings from July 2012

Re: [perl #114178] di/ds/ig exempt from warnings in void context

Thread Previous | Thread Next
Nicholas Clark
July 18, 2012 07:35
Re: [perl #114178] di/ds/ig exempt from warnings in void context
Message ID:
On Wed, Jul 18, 2012 at 04:31:06PM +0200, Paul Johnson wrote:
> On Wed, Jul 18, 2012 at 02:45:43PM +0100, Nicholas Clark wrote:
> > On Wed, Jul 18, 2012 at 03:35:25PM +0200, Paul Johnson wrote:
> > 
> > > As far as removing it is concerned, I presume that no one is writing new
> > > code in this way, and probably hasn't for a few years.  So the removal
> > > is a trade-off between a slight standardisation and simplification and
> > > breaking backwards compatibility with some perl4 era programs.
> > > 
> > > I would side with keeping backwards compatibility.
> > 
> > One could fudge it (by increasing complexity) by making it warn in any
> > source file using a perl 5 construction. Probably the simplest is *just*
> > to set a flag if C<use> is used.
> I'm not convinced it warrants any increase in complexity, especially for
> something that would still be a heuristic.

No, I'm not convinced either. It's only a heuristic of "not perl 5 code"
Because if it's got C<use> in it, it's a syntax error in perl 4:

/usr/local/perl4/bin/perl4.036  -e 'use strict'
syntax error in file /tmp/perl-erpHBaB at line 1, next 2 tokens "use strict"
Execution of /tmp/perl-erpHBaB aborted due to compilation errors.

so it must be perl 5 code, so it can use Pod and be happy.

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About