Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Tk events and a server socket

by strredwolf (Chaplain)
on Oct 29, 2001 at 08:53 UTC ( [id://121877]=perlquestion: print w/replies, xml ) Need Help??

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";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://121877]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-18 20:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found