in reply to simple tk counter

After pressing the button, I'm refreshing the window, but this doesn't seem to yield the desired result of showing the new value

Hi, I don't use Tk at all, but, maybe try:

$mw -> Button( -text => 'Count', -command => sub { ++$count; $mw -> + update; } ) ->pack();
... which will increment the value of $count before using it, instead of after.

Hope this helps!


The way forward always starts with a minimal test.