Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use strict does not warn about attempts to do array arithmetic #19071

Closed
philiprbrenan opened this issue Aug 22, 2021 · 2 comments
Closed

Use strict does not warn about attempts to do array arithmetic #19071

philiprbrenan opened this issue Aug 22, 2021 · 2 comments

Comments

@philiprbrenan
Copy link

Please make use strict warn about attempts to do arithmetic on array references.

use strict;
say STDERR [1] + [2]; # 188385713997216

@Corion
Copy link

Corion commented Aug 22, 2021

The strict pragma does not issue warnings. It prohibits operations or enforces declarations.

If you intend this as a feature request, please consider following the RFC process as discussed at https://www.nntp.perl.org/group/perl.perl5.porters/2021/06/msg260336.html instead of rapid-fire posting bug reports.

@leonerd
Copy link
Contributor

leonerd commented Aug 22, 2021

Addition adds numbers. Plain references yield their refaddr when used numerically. This is all documented and self-consistent.

I will remind you of Leon T's recent comment, that the Perl5 github issues list is not a help channel.

@leonerd leonerd closed this as completed Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants