in reply to Tk Mainloop - no exit.

I'm not sure what Asterisk::AMI does, but it seems to be blocking your Tk eventloop. You may need to the Asterisk tasks in a thread, then use Tk::fileevent to read the socket. See Re: Perl Tk and Threads and google for "perl tk threads" for other examples.


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Replies are listed 'Best First'.
Re^2: Tk Mainloop - no exit.
by Laotsu (Initiate) on Nov 09, 2010 at 05:04 UTC
    zentara,

    Asterisk::AMI is the management interface to an Asterisk VOIP server. I use it to make calls, inject DTMF, hangup, etc. It can be event driven, but I am not using callbacks. What I don't understand is that I disconnect from it and undef $asterisk, but something is lingering.

    I was hoping there was some way to completely remove any remnants of my call to asterisk::AMI. I'd rather not start new threads.

        I was trying undef without success. I was hopeful about Object::Destroyer, but that didn't help my problem. It was good to discover though! But I'm about to give up.

        The strange thing is that creating a totally unrelated object can cause Mainloop to not exit. Why would Mainloop even care?