$ perl -wE 'say (1 == 0) ? "Yes" : "No"'
say (...) interpreted as function at -e line 1.
Useless use of a constant ("Yes") in void context at -e line 1.
Useless use of a constant ("No") in void context at -e line 1.
$ perl -wE 'say +(1 == 0) ? "Yes" : "No"'
No
####
$ perl -wle 'print (1 == 0) ? "Yes" : "No"'
print (...) interpreted as function at -e line 1.
Useless use of a constant ("Yes") in void context at -e line 1.
Useless use of a constant ("No") in void context at -e line 1.
$ perl -wle 'print +(1 == 0) ? "Yes" : "No"'
No
$ perl -we 'printf (1 == 0) ? "Yes\n" : "No\n"'
printf (...) interpreted as function at -e line 1.
Useless use of a constant ("Yes\n") in void context at -e line 1.
Useless use of a constant ("No\n") in void context at -e line 1.
$ perl -we 'printf +(1 == 0) ? "Yes\n" : "No\n"'
No
##
##
$ perl -wle 'use constant X => "x"; my %x = (x => 42); print $x{X}'
Use of uninitialized value in print at -e line 1.
$ perl -wle 'use constant X => "x"; my %x = (x => 42); print $x{+X}'
42
##
##
$ perl -wE 'sub f { @_ } say f(42)'
42
$ perl -wE 'sub f { @_ } say+f(42)'
42
$ perl -wE 'sub f { @_ } say +f(42)'
42
##
##
$ perl -MO=Deparse,-p -e 'sub f { @_ } print f(42)'
sub f {
@_;
}
print(f(42));
-e syntax OK
$ perl -MO=Deparse,-p -e 'sub f { @_ } print+f(42)'
sub f {
@_;
}
print(f(42));
-e syntax OK
$ perl -MO=Deparse,-p -e 'sub f { @_ } print +f(42)'
sub f {
@_;
}
print(f(42));
-e syntax OK