in reply to Question about alarm()

I think another approach you might consider taking would be spawning off the music player in a separate thread and taking the input on the main thread, or vice versa.

Take a look at Markup in the Monastery to find out how to use those handy code tags and others ;)

Replies are listed 'Best First'.
Re^2: Question about alarm()
by skywalker (Beadle) on Mar 06, 2009 at 15:22 UTC
    I had a similar problem with a TK GUI app I wrote. I found using alarm to be the best solution as threads are great however sending and receiving data can get quite complex pretty quick.

    try

    my $timer_start = $mw->after(1000 => \&yoursub); $mw->afterCancel($timer_start);
    thanks skywalker