need help with Tk: I could not figure the error

2009-09-02 Thread Daniel Burgaud
I have this test script below. A toplevel containing a button that invokes another toplevel. The first time I invoke this second window, all works fine and returns properly without error. however, when I reenter again (clicking on "Get Number" button) I get this error message. Tk::Error: not a T

RE: need help with Tk: I could not figure the error

2009-09-02 Thread Brian Raven
From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Daniel Burgaud Sent: 02 September 2009 15:27 To: Perl-Win32-Users Subject: need help with Tk: I could not figure the error > I have this test script below. > > A topleve

Re: need help with Tk: I could not figure the error

2009-09-02 Thread Daniel Burgaud
Hi All, Here is the message I got after using "use warnings;" and "use diagnostics;". Variable "$number" will not stay shared at x.pl line 36 (#1) (W closure) An inner (nested) named subroutine is referencing a lexical variable defined in an outer subroutine. When the inner subroutin

Re: need help with Tk: I could not figure the error

2009-09-02 Thread Daniel Burgaud
Hi When I moved all the variables within the subroutines outside, this script suddenly worked flawlessly. What gives? Wasnt it highly desireable to "localize" variables to make it more organized? yet when i did just that, it fails to run. Only when I made all variables GLOBAL that it worked. Th