develooper Front page | perl.perl5.porters | Postings from December 2015

Re: [perl #127063] Setting $[ = 0 should not generate a warning

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
December 31, 2015 12:33
Subject:
Re: [perl #127063] Setting $[ = 0 should not generate a warning
Message ID:
20151231123252.GA61858@plasmasturm.org
* Zefram <zefram@fysh.org> [2015-12-29 01:35]:
> The only purpose of assigning to $[ in Perl 5 is if the code is
> actually Perl 4 code, and needs to remain runnable on Perl 4.

The only purpose of warning about `$[ = 0` is if there were plans to
change the nature of $[ in ways that make that statement not a no-op.

Otherwise there is no point in bugging users about the fact that the
programmer who wrote the code they’re using put something in it that
doesn’t have any effect (whether good or bad) but is just stylistically
discouraged by the Perl community.

That sort of thing belongs in a linter to inform the programmer writing
the code – not in a warning for the user just running the code.

Strictly speaking this is even true of `$[ = 1` but that does actually
does something so there is ever so much more of a case for a warning.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About