in reply to - and + sign before keys, when pass parms to Tk functions

This is part serendipity on the part of the Tk developer and part misunderstanding on your part. That leading '+' is a unary plus and from reading perlop you'll see "Unary "+" has no effect whatsoever, even on strings.". Reading slightly above that you'll see "a string consisting of a minus sign concatenated with the identifier is returned". All this means is "+background" becomes "background" and "-background" becomes "-background".

From here it's up to the Tk developers to do something useful with the arguments. In general you just aren't supposed to pass a parameter in using both the bare and '-' prefixed form. You've just managed to highlight that Tk will take the bare parameter in preference to the '-' prefixed parameter. That's probably just the order that Tk does something with the parameters but /maybe/ that's also just related to the order that 'background' and '-background' occur inside a hash. Just do something sane and pick a style, ok? (and remember to read perlop)

Just for giggles I did a demo of your examples but in generalized form because this really has nothing to do with Tk or any other modules.

use Data::Dumper; { my %x = (background => 'red'); print Dumper(\%x), "\n" } # $VAR1 = { 'background' => 'red' }; { my %x = (-background => 'red'); print Dumper(\%x), "\n" } # $VAR1 = { '-background' => 'red' }; { my %x = (+background => 'red'); print Dumper(\%x), "\n" } # $VAR1 = { 'background' => 'red' }; { my %x = (+background => 'red', +background => 'green'); print Dumper(\%x), "\n" } # $VAR1 = { 'background' => 'green' }; { my %x = (+background => 'red', -background => 'green'); print Dumper(\%x), "\n" } # $VAR1 = { '-background' => 'green', 'background' => 'red' };
__SIG__ use B; printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B::svref_2object(sub{})->OUTSIDE;