Unary + doesn't do anything on its operand, unlike unary - which does force scalar context:
use v5.14; use warnings; use strict; sub array { my @array = ("Hello ", "World"); @array; } say array; say+array; say-array; # warning here say scalar array;
Ambiguous use of -array resolved as -&array() at context.pl line 13. Hello World Hello World -2 2
In reply to Re^2: usage of '+' sign in say statement
by Eily
in thread usage of '+' sign in say statement
by seki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |