Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Odd lexical variable behavior -- why does this happen?

by radiantmatrix (Parson)
on Sep 13, 2007 at 15:36 UTC ( [id://638831]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Odd lexical variable behavior -- why does this happen?
in thread Odd lexical variable behavior -- why does this happen?

Aha! Thank you!

The work-around you presented is one approach, my particular answer was to

$pb->configure( -variable => undef );
on the way out of scope. Thanks for shedding light on this, I don't know how or why I missed this when I scanned ProgressBar.pm...

As for "Changing the var that holds the progress shouldn't change the value of the progress bar", I sort of disagree. Since ProgressBar doesn't actually update that variable, I'd expect that changing to a different variable, you'd want to use that variable's value. As the documentation for Tk::ProgressBar says about -variable:

Specifies the reference to a scalar variable to link to the ProgressBar. Whenever the value of the variable changes, the ProgressBar will upate to reflect this value.

I'd expect that changing variables entirely would also change "the value of the variable", but obviously others (including the original author) have different expectations.

Thanks again for the insight. ++!

<radiant.matrix>
Ramblings and references
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://638831]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-19 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found