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:
Does PERL have an equivalent to HTML's REFRESH

 



axaflaxar
Novice

Jan 8, 2003, 6:00 AM

Post #1 of 7 (1714 views)
Does PERL have an equivalent to HTML's REFRESH Can't Post

What I am wandering is does PERL have an equivalent to HTML's REFRESH command? I want the program to keep running so that my text file will be updated every 10 seconds or so.
Can this be done? If so how?

The text file is currently being updated when I open WS-FTP and hit the refresh button to view new data in the text file


davorg
Thaumaturge / Moderator

Jan 8, 2003, 7:02 AM

Post #2 of 7 (1707 views)
Re: [axaflaxar] Does PERL have an equivalent to HTML's REFRESH [In reply to] Can't Post

Perl can almost certainly do what you want, but it's a little unclear exactly what you're trying to achieve. Are you talking about a CGI program? Is the text file being generated by the Perl program? Where does FTP enter into this scenario?

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


kidd
User

Jan 8, 2003, 8:24 AM

Post #3 of 7 (1706 views)
Re: [axaflaxar] Does PERL have an equivalent to HTML's REFRESH [In reply to] Can't Post

You can maybe run the script and use the sleep() function...

Something like this:


Code
use strict; 

sub process{

#enter your file process here

&finish;

}

sub finish{

if( #something){
#maybe something that made the program stop
exit;
}else{
sleep(10); #sleep for 10 seconds
&process;
}

}


Maybe that's something you're looking for. Or if you are under an Unix OS you may want to use the cron function.

"So you want to be a cowboy
Well you know it's more than just a ride
Guess you got to know the real thing
If you want to know the other side
Ain't nobody riding shotgun
In this world tonight"


axaflaxar
Novice

Jan 8, 2003, 11:05 AM

Post #4 of 7 (1703 views)
Re: [davorg] Does PERL have an equivalent to HTML's REFRESH [In reply to] Can't Post

Hello,

Yes it would be a CGI program and the CGI program I have writes data to a text file. I was just telling about the FTP program in hopes that the more info I gave the better someone could assist me.


axaflaxar
Novice

Jan 8, 2003, 11:08 AM

Post #5 of 7 (1702 views)
Re: [kidd] Does PERL have an equivalent to HTML's REFRESH [In reply to] Can't Post

Hello kidd,

UHHH, I don't even know what a sleep function is!! Sly But it sounds like that is what I am looking for. I will plug my code in and see how it works.



Thanks!!


Paul
Enthusiast

Jan 9, 2003, 3:08 AM

Post #6 of 7 (1695 views)
Re: [axaflaxar] Does PERL have an equivalent to HTML's REFRESH [In reply to] Can't Post

It is not very wise to use sleep() to keep your script running, you should use cron for such a task, although again to run it every 10 seconds it not sensible or possible.

I think perhaps you need to rethink what you are trying to achieve.

Like dave though, I'm still not clear on what you are even doing.


axaflaxar
Novice

Jan 9, 2003, 5:32 AM

Post #7 of 7 (1686 views)
Re: [Paul] Does PERL have an equivalent to HTML's REFRESH [In reply to] Can't Post

Hey Paul,

Thanks for your insight. Basically my supervisor wanted to know if the files could update automatically. I don't even think he knows what he wants. I really don't evn know!! He is a reasonable dude though.



Thanks again

 
 


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

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