CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Is it possible to have "live" scripts in Perl like chat rooms?

 



Merlin
journeyman

Dec 6, 2000, 2:00 PM

Post #1 of 5 (297 views)
Is it possible to have "live" scripts in Perl like chat rooms? Can't Post

I was wondering if it's possible to have live scripts to do stuff like chatrooms and live feeds from data on the server? Can the server and the browser have a "permanent" connection and not do the two way trip each time? Thx!


Lawrence
Novice

Dec 7, 2000, 12:47 AM

Post #2 of 5 (297 views)
Re: Is it possible to have "live" scripts in Perl like chat rooms? [In reply to] Can't Post

Unfortunately, no, the session is terminated each time a script completes it's tasks.

I did once create a chat script that appeared live, even though it wasn't. I created an invisible frame (ie: width 0) with a form in it that contained a textarea and that was it. In the "real" chat part, there was a textarea, text input for your own messages and button. When you pressed the button, a JavaScript sent the text input contents (ie: your message) to the textarea in the invisible frame. The invisible frame used a JavaScript to submit the form every 10 seconds. When submitting, the textarea contents was sent to a perl chat script, which reprinted the form in the invisible frame, and also another JavaScript to transfer any new messages the perl script found to the visible textarea.

Complicated stuff, and hard to explain... :{


------------------
Encore Web Forum
Extremely versatile and 100% customisable forum software!
http://www.aborior.com/products/encore


Merlin
journeyman

Dec 8, 2000, 7:24 PM

Post #3 of 5 (297 views)
Re: Is it possible to have "live" scripts in Perl like chat rooms? [In reply to] Can't Post

Thanks for the info. I guess this is a fair enough workaround. I've heard something about sockets for live stuff, does anyone know something about this?

p.s.: ah, finally got enough message to get my "member" status. Cool! ;)


sleuth
Enthusiast / Moderator

Dec 8, 2000, 11:40 PM

Post #4 of 5 (297 views)
Re: Is it possible to have "live" scripts in Perl like chat rooms? [In reply to] Can't Post

 
Ok, I found something poking around, at
http://hotwired.lycos.com/webmonkey/97/18/index2a.html

Just keep poking, POKE POKE POKE!

Sleuth


sleuth
Enthusiast / Moderator

Dec 9, 2000, 10:27 AM

Post #5 of 5 (297 views)
Re: Is it possible to have "live" scripts in Perl like chat rooms? [In reply to] Can't Post

 
Yea, I've heard that there are ways of using sockets to connect two or more computers together so when you submit your data, it's sent to the other computers imediatly. It's so unlike perl to support instant communication, but it's probably not possible. I'd do a lot of research on sockets and find out, I'm sure you could play with them and come up with something. Even if you do connect using sockets, it seems that it wouldn't stay on because the perl script will always exit after executing, you'd have to keep it running, and to do that, you have to create a daemon proccess, which runs of the cron to keep it running, Just thinking about it, maybe you could use goto label and put the goto at the bottom, and the label at the top, that should keep it running over and over, he he he he, of course I'm j/k about that.

Sleuth

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives