strredwolf has asked for the wisdom of the Perl Monks concerning the following question:

I've poured through Tk's "fileevent" documentation, but nothing specific on this particular problem. I'm trying to handle a server socket inside a Perl/Tk script. The script will take the incomming connections and display a line or two that's read off of the connection in a window or five. (Yes, it's perl-instant-messanger-in-under-7k!)

So far, my best guess is this:

$main->fileevent($server,READABLE,sub {&handler});
Where sub handler {...} will read in the incomming message and display it as need be.

--
$Stalag99{"URL"}="http://stalag99.keenspace.com";

Replies are listed 'Best First'.
Re: Tk events and a server socket
by orkysoft (Friar) on Oct 29, 2001 at 17:46 UTC

    The part sub {&handler} doesn't look good.

    Either use sub { statement } to embed a sub there or \&handler to refer to the sub called handler.

    Now try again and tell us if things still go wrong :-)

Re: Tk events and a server socket
by strredwolf (Chaplain) on Oct 29, 2001 at 13:07 UTC
    For those looking for a question, will that line above actually work?

    --
    $Stalag99{"URL"}="http://stalag99.keenspace.com";