RE: assess what subroutines are currently being called
"Van Nieuwenhuize, Mike" <[email protected]> Wed, 11 Apr 2007 10:42:41 -0700
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <[email protected]> |
Sound like you are trying to figure out the name of a calling subroutine, is that correct? If so you can try using the caller() function. See the perldocs on this to get specifics on the arguments and return values for this function. Mike -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of listmail Sent: Wednesday, April 11, 2007 10:38 AM To: Perl TK Mailing List Subject: Re: assess what subroutines are currently being called I had assumed that if an event was running a sub and if the client pressed a widget button which also called a sub that the subs would execute in parallel. If it is actually that a button (-command) call would actually have to wait for the event sub (if already running) to return, then this would mean there is no need for what I am attempting. My thougthts where was that I should get the program to exit gracefully if a client hasn't responded to a program update notification (afk). I didn't want to disconnect databases and call and exit if the user was in the middle of running a subroutine associated to a widget he had pressed. Hope that clears my question up a little. Ala Qumsieh wrote: > --- listmail <[email protected]> wrote: > > >> I have a top level widget event timer that calls a sub routine >> periodically and does some checks. >> >> I'd like to add some code, for specific reasons, to be able to assess >> what other subroutines are currently being executed with the >> mainloop. >> Is this possible? I'd expect the call to always indicate the event >> sub to be running so any additional subs is what I am interested in. >> > > Not sure what you mean. Unless you're using threads, there is only one > active subroutine at any one time. > But, here's an idea. You can use global variables to track your > progress. At the beginning of a subroutine, set the value of a > specific var to 1. At the end set to 0. It's not pretty, but should be > good 99% of the time. > > --Ala > > > > > ______________________________________________________________________ > ______________ > TV dinner still cooling? > Check out "Tonight's Picks" on Yahoo! TV. > http://tv.yahoo.com/ > > --++**==--++**==--++**==--++**==--++**==--++**==--++**== ptk mailing list [email protected] https://mailman.stanford.edu/mailman/listinfo/ptk --++**==--++**==--++**==--++**==--++**==--++**==--++**== ptk mailing list [email protected] https://mailman.stanford.edu/mailman/listinfo/ptk