[Melbourne-pm] Postfix conditionals and creating lexicals

David Warring david.warring at gmail.com
Thu Jul 12 23:46:34 PDT 2012


Rather than losing a whole raft of language constructs, I'd prefer to be
able to tell Perl to behave sanely.

Maybe the behaviour could be controlled and modified as a
feature<http://perldoc.perl.org/feature.html>
?

      use feature 'no_implied_static'; # just for example
      my $foo if 0;                              #  now behaves sanely
without warnings.

- David

On Fri, Jul 13, 2012 at 1:40 PM, Mathew Robertson <
mathew.blair.robertson at gmail.com> wrote:

>
>> looks like targetting the specific idiom:
>>   my $foo ... if 0
>>
>> should warn about any
>>   my $foo ... if ...
>>
>> > So while we can argue about whether or not its a bug
>>
>> unintended dis-recommended 'features' are bugs, categorically
>>
>> > If I get around to it I'll open a bug report, even if its just asking
>> > for better warnings. I doubt I'll have time to work up a patch myself.
>>
>> If can detect the pattern with 'use warnings', I guess not too hard
>> to make it a syntax error in the core.  Maybe don't want to break
>> existing abuse of it, so leave it in use warnings / use strict.
>>
>>
> Given that recent releases are specifically deprecating some
> functionality, I dont see why this shouldn't be upgraded from warning, to
> error. ie: any syntax of
>
> my .... if ...
> local .... if ...
> our ... if ...
>
> and dont forget 'unless'.
>
>
>
>
> _______________________________________________
> Melbourne-pm mailing list
> Melbourne-pm at pm.org
> http://mail.pm.org/mailman/listinfo/melbourne-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/melbourne-pm/attachments/20120713/db9ef1a3/attachment.html>


More information about the Melbourne-pm mailing list