in reply to Odd lexical variable behavior -- why does this happen?
This appears to be an undocumented oddity of Tk::ProgressBar: when you give it a reference to a variable, it immediately stores the current value into the variable. I don't think widgets should do that, and certainly not without documenting it. But there you go.
To test this theory, add the following callback on another button:
sub dont_count_up { my $progress = 0; $pb->configure( -variable => \$progress ); print "progress=$progress\n"; }
|
|---|