in reply to tk, fileevent, and MS Windows
Just a quick glance, one thing stands out: in your $mw->fileevent declaration the compiler is thinking that you are declaring the entire sub new_connection(). What you want to do instead is pass a reference to the sub:
$mw->fileevent( $listen, 'readable', [ \&new_connection, $listen ] );
I'm --fairly-- sure that what I'm doing with the anonymous list brackets for the callback function is what works in Tk for passing parameters to the sub. I've done it before but my scripts doing that are elsewhere on a different machine.
Cheers!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: tk, fileevent, and MS Windows
by momo33 (Beadle) on Mar 21, 2011 at 17:12 UTC |