in reply to usage of '+' sign in say statement

Howdy!

The "+" forces scalar context for the call to localize_strftime. I'm not clear on the benefit of that in this specific example, given that the sub is not context sensitive.

yours,
Michael

Replies are listed 'Best First'.
Re^2: usage of '+' sign in say statement
by Eily (Monsignor) on Dec 05, 2017 at 16:49 UTC

    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