develooper Front page | perl.perl5.porters | Postings from May 2001

[ID 20010515.003] "Useless use of contatenation" warning onlyappears with two children?

Thread Next
From:
Philip Newton
Date:
May 15, 2001 04:22
Subject:
[ID 20010515.003] "Useless use of contatenation" warning onlyappears with two children?
Message ID:
3B012D78.29079.119900D@localhost
Observe:

$ ./perl -w -e '($a,$b)=(42)x2; $a . $b'
Useless use of concatenation (.) or string in void context at -e line 1.
$ ./perl -w -e '($a,$b,$c)=(42)x3; $a . $b . $c'
(nothing)

To me, the second concatenation is also in void context. Even if you 
parenthesize it, (($a . $b) . $c), the first concatenation is in scalar 
context because its value is used for the second concatenation -- but 
the second concatenation, at least, is in void context, isn't it?

category=core
severity=low

Cheers,
Philip


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