I'm not positive about this...

I'm not positive about this, but I'm not sure that things are behaving as I would expect. What would you expect the following lines to output?

perl -E 'say "x"; say -"x"; say -"-x"; say -"+x";'

For me, lines 1 and 2 make sense. Lines 3 and 4 are different than I would expect, but I'm not sure that they are really wrong. Does somebody want to explain what is really happening, and why it is that way?

What's going on here?

What do you think the following lines print?

use feature 'say';
sub fmt { sprintf( @_[0, 1] ) }
my $num = 1_234_567_890.12_345_678_9;
say sprintf( '%.6f', $num );
say fmt( '%.6f', $num );

I think the two say lines should both print out the same value, 1234567890.123457. The first line behaves as expected, but the second does not. Does anybody have any idea on why?

Playing around with the code, I’ve figured out how to fix the issue, but I’m curious as to thoughts and explanations from the community.