> On Sun, Sep 15, 2013 at 6:59 PM, Charles DeRykus
> wrote: left: ", $start+$sleep -time() };
> ...
Actually, this is wrong because if sleep(3) is interrupted by any signal
it
will return, so something like this should work, eg
my $secs_to_sleep = 60;
my $start = time();
my
(DOH - Obviously I was using 10 seconds to test!)
On 16 Sep 2013, at 00:49, "John W. Krahn" wrote:
> Shawn H Corey wrote:
>> On Sun, 15 Sep 2013 13:00:36 -0700
>> Unknown User wrote:
>>
>>> If my perl script has a sleep for say 300 seconds, when the s
Hi, I might be being a noob but reading the OP, aren't they wanting to call the
value arbitrarily? Meaning, e.g. an Ajax call in a web page could send a
request to find out the time remaining in the sleep.
I guess that the sleep (which will halt the script) needs to be invoked after
fo
Shawn H Corey wrote:
On Sun, 15 Sep 2013 13:00:36 -0700
Unknown User wrote:
If my perl script has a sleep for say 300 seconds, when the sleep is
being run is there any way i can find the time remaining in the sleep
say by sending a signal?
Thanks,
Not directly. You have to record the time
On Sun, 15 Sep 2013 13:00:36 -0700
Unknown User wrote:
> If my perl script has a sleep for say 300 seconds, when the sleep is
> being run is there any way i can find the time remaining in the sleep
> say by sending a signal?
>
> Thanks,
Not directly. You have to record the
If my perl script has a sleep for say 300 seconds, when the sleep is being
run is there any way i can find the time remaining in the sleep say by
sending a signal?
Thanks,
On Jun 18, 6:50 am, rvtol+use...@isolution.nl ("Dr.Ruud") wrote:
> On 2011-06-17 05:34, C.DeRykus wrote:
>
>
> > Ruud:
> >> C.DeRykus:
> >>> Ruud:
> C.DeRykus:
> > Another solution, not necessarily more elegant, but
> > more familiar to most is an eval {} and alarm pair:
>
> > EVA
On 2011-06-17 05:34, C.DeRykus wrote:
Ruud:
C.DeRykus:
Ruud:
C.DeRykus:
Another solution, not necessarily more elegant, but
more familiar to most is an eval {} and alarm pair:
EVAL: {
eval {
local $SIG{ ALRM } = sub { die "alarm"; };
local $SIG{ USR1 } = s
On Jun 16, 3:00 pm, rvtol+use...@isolution.nl ("Dr.Ruud") wrote:
> On 2011-06-16 19:16, C.DeRykus wrote:
>
>
>
> > Ruud:
> >> C.DeRykus:
> >>> Another solution, not necessarily more elegant, but
> >>> more familiar to most is an eval {} and alarm pair:
>
> >>> EVAL: {
> >>> eval {
> >>>
On 2011-06-16 19:16, C.DeRykus wrote:
Ruud:
C.DeRykus:
Another solution, not necessarily more elegant, but
more familiar to most is an eval {} and alarm pair:
EVAL: {
eval {
local $SIG{ ALRM } = sub { die "alarm"; };
local $SIG{ USR1 } = sub { die "usr1" };
On Jun 16, 1:54 am, rvtol+use...@isolution.nl ("Dr.Ruud") wrote:
> On 2011-06-15 14:18, C.DeRykus wrote:
>
> > [...] mixing
> > alarm/sleep is a bad idea. See: perldoc -f alarm.
>
> > Another solution, not necessarily more elegant, but
> > more fam
On 2011-06-15 14:18, C.DeRykus wrote:
[...] mixing
alarm/sleep is a bad idea. See: perldoc -f alarm.
Another solution, not necessarily more elegant, but
more familiar to most is an eval {} and alarm pair:
EVAL: {
eval {
local $SIG{ ALRM } = sub { die "
a signal, restarts sleeping again for the
> > full time period until it receives another signal or the
> > timer elapses. In the latter case it should just exit.
> > Something like:
>
> > sub sleeper {
> > warn strftime("%H:%M:%S sleep $slee
er elapses. In the latter case it should just exit.
> Something like:
>
> sub sleeper {
> warn strftime("%H:%M:%S sleep $sleeptime\n", localtime);
> $SIG{USR1}=\&sleeper;
> sleep $sleeptime;
> };
>
> warn $$;
> sleeper;
>
> It sounds v
case it should just exit.
Something like:
sub sleeper {
warn strftime("%H:%M:%S sleep $sleeptime\n", localtime);
$SIG{USR1}=\&sleeper;
sleep $sleeptime;
};
warn $$;
sleeper;
It sounds very simple, but I can't get it to work as intended.
I tryied it in numberle
Michael Alipio wrote:
Hi,
Hello,
I have a script that forks a child. at the parent, i have a line that
tells it to sleep for n seconds. Once the 3 seconds have passed, it
will kill the child process.
I noticed that most of the time, sleep doesn't count exact seconds..
most of the time
On Wed, Apr 22, 2009 at 09:27, Michael Alipio wrote:
>
> Hi,
>
> I have a script that forks a child. at the parent, i have a line that tells
> it to sleep for n seconds. Once the 3 seconds have passed, it will kill the
> child process.
>
> I noticed that most of the t
Hi,
I have a script that forks a child. at the parent, i have a line that tells it
to sleep for n seconds. Once the 3 seconds have passed, it will kill the child
process.
I noticed that most of the time, sleep doesn't count exact seconds.. most of
the time it's longer. Is there
Thank You.
-Original Message-
From: Taylor, Andrew (ASPIRE) [mailto:andrew.tayl...@hmrcaspire.com]
Sent: Wednesday, March 04, 2009 3:51 PM
To: beginners@perl.org
Subject: RE: Sleep
>Hi,
>
>How could I introduce a Sleep in Perl? Is there any specific function
>for that
>Hi,
>
>How could I introduce a Sleep in Perl? Is there any specific function
>for that?
>
>regards,
>-ramesh
Yes.
It's called.... sleep
sleep n - will sleep for n seconds (miss off the number and it'll
sleep until interrupted)
Capgemini is a tra
Hi,
How could I introduce a Sleep in Perl? Is there any specific function
for that?
regards,
-ramesh
P Save a tree...please don't print this e-mail unless you really need to
Please do not print this email unless it is absolutely necessary.
The information contained in this elect
On Oct 16, 2:09 pm, [EMAIL PROTECTED] (Jenda Krynicky) wrote:
> use FileHandle;
The FileHandle module exists largely for reasons of backward
compatibility.
New code should:
use IO::Handle;
or
use IO::File;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMA
From: [EMAIL PROTECTED]
> I would expect the following script:
>
> use strict;
> use warnings;
> print 8*8;
> sleep 3;
> print 7*7;
>
> To behave as follows.
>
> 1. print 64.
> 2. pause 3 seconds.
> 3. print 49.
&g
On Oct 16, 6:11 am, [EMAIL PROTECTED] (Chas. Owens) wrote:
> On 10/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > I would expect the following script:
>
> > use strict;
> > use warnings;
> > print 8*8;
> > slee
On 10/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I would expect the following script:
>
> use strict;
> use warnings;
> print 8*8;
> sleep 3;
> print 7*7;
>
> To behave as follows.
>
> 1. print 64.
> 2. pause
Try setting buffering off, its probably due to that as it should do a,b,c
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 16 October 2007 02:50
To: beginners@perl.org
Subject: Sleep apnea
I would expect the following script:
use strict;
use
I would expect the following script:
use strict;
use warnings;
print 8*8;
sleep 3;
print 7*7;
To behave as follows.
1. print 64.
2. pause 3 seconds.
3. print 49.
Instead the behavior is:
1. pause 3 seconds.
2. print 64.
3. print 49.
Why
TOKO <[EMAIL PROTECTED]> asked:
> hi. I'm new at perl and am looking for solution of let script
> sleep for few miliseconds. I tried sleep(0.1); but it does
> not work :) as I thought. than I found this solution: select
> undef, undef, undef, .01; but it freezes sc
TOKO wrote:
hi. I'm new at perl and am looking for solution of let script sleep for
few miliseconds. I tried sleep(0.1); but it does not work :) as I
thought. than I found this solution: select undef, undef, undef, .01;
but it freezes script and it does not continue.
Thanks for any
TOKO wrote:
hi. I'm new at perl and am looking for solution of let script sleep for
few miliseconds. I tried sleep(0.1); but it does not work :) as I
thought.
Easist way IMO is to use Time::HiRes:
use Time::HiRes qw(sleep);
sleep(0.1);
> than I found this solution: sele
hi. I'm new at perl and am looking for solution of let script sleep for
few miliseconds. I tried sleep(0.1); but it does not work :) as I
thought. than I found this solution: select undef, undef, undef, .01;
but it freezes script and it does not continue.
Thanks for any ideas. TOKO
HI,
I found a problem in my script.I call sleep function in a child process
(sleep 3600 sec,then wake up and do something).
But these days I found sleep can't wake up.I checked it carefully,and
find that when sleeping,if disks I/O error occured (such as 100% disks
space using,no free spac
k in top I see the program uses 0% CPU while sleeping.
I would like to make my program as responsive as possible so I was
wondering if there was some way to make this more efficient? Like some way
to tell perl to sleep indefiantely unless $listen becomes d
- Original Message -
From: TapasranjanMohapatra <[EMAIL PROTECTED]>
Date: Wednesday, February 9, 2005 9:17 am
Subject: while(1){print "a"; sleep 1;}
> Hi All,
Hello,
>
> Why I dont get a's printed with the code below?
Works well on my system, are you su
TapasranjanMohapatra ha scritto:
Hi All,
Why I dont get a's printed with the code below?
+++
while(1)
{
print "a";
sleep 1;
}
+++
It works well if I print a newline with a, i.e
while(1)
{
print "a\n"; # newline
-Original Message-
From: Chris Devers [mailto:[EMAIL PROTECTED]
Sent: Wed 2/9/2005 8:01 PM
To: TapasranjanMohapatra
Cc: Perl Beginners List
Subject:Re: while(1){print "a"; sleep 1;}
On Wed, 9 Feb 2005, TapasranjanMohapatra wrote:
> Why I dont get a
On Wed, 9 Feb 2005, TapasranjanMohapatra wrote:
> Why I dont get a's printed with the code below?
Apparently it's an output buffering issue.
If you flush output, it works:
$ perl -e 'while(1){print"a";sleep 1}'
^C
$ perl -e '$|=1;while(1){print&quo
TapasranjanMohapatra [T], on Wednesday, February 9, 2005 at 19:47
(+0530) typed the following:
T> It works well if I print a newline with a, i.e
I hope it works without sleep 1, try that, and you will see the
answer.
--
...m8s, cu l8r, Brano.
["You should never go in there w
Hi All,
Why I dont get a's printed with the code below?
+++
while(1)
{
print "a";
sleep 1;
}
+++
It works well if I print a newline with a, i.e
while(1)
{
print "a\n"; # newline with a
sleep 1;
}
Please help if
Wiggins d Anconia wrote:
> cron can be installed as part of the Cygwin distro, not sure about
> other ways. The M$ products come with a scheduler as well, but you
> have now exhausted my knowledge of it ;-)
The MS "at" service blows huge chunks.
There is a cron for Windows at http://cronw.so
>
> My main concern was that the script would die from SIGALARM. I'm
testing on
> and XP box and using the script on a FreeBSD box. How can I get the cron
> function on my XP box?
>
In general this is a bad idea, aka developing/testing on a different
platform than where it will run eventuall
My main concern was that the script would die from SIGALARM. I'm testing on
and XP box and using the script on a FreeBSD box. How can I get the cron
function on my XP box?
Also I have to get admin permission for cron jobs. Which I don't think will
be a problem.
It's not important that th
>
> Hi all,
>
> I'm writing a script which fetches data every hour. I thought instead of
> using cron which is platform dependent, to use sleep and a goto
statement. Is
> there any downfalls to this?
Sure, all of the differences between a one-off script and a con
On Tue, 2004-05-18 at 16:02, [EMAIL PROTECTED] wrote:
> Hi all,
>
> I'm writing a script which fetches data every hour. I thought instead of
> using cron which is platform dependent, to use sleep and a goto statement. Is
> there any downfalls to this?
Other downfalls:
-
On Tue, 2004-05-18 at 16:02, [EMAIL PROTECTED] wrote:
> Hi all,
>
> I'm writing a script which fetches data every hour. I thought instead of
> using cron which is platform dependent, to use sleep and a goto statement. Is
> there any downfalls to this?
Yes.
With sleep,
Hi all,
I'm writing a script which fetches data every hour. I thought instead of
using cron which is platform dependent, to use sleep and a goto statement. Is
there any downfalls to this?
At the start of the script I check to see if it was ran in the previous hour.
BEGINNING:
if
On 02/22/04 05:09, daniel wrote:
Hi helpers,
I'm very new in perl programming(in programming at all acutally) and
wondering about the following piece of code which I was running under
W2K command-line:
print "First";
sleep 2;
print "Second";
I thought the script would pr
$| = 1; #Autoflush
print "First";
sleep 2;
print "Second";
-Will
---
Handy Yet Cryptic Code.
Just to Look Cool to Look at and try to decipher without running it.
Windows
perl -e "printf qq.%3i\x20\x3d\x20\x27%c\x27\x09.,$_,$_ for
Hi helpers,
I'm very new in perl programming(in programming at all acutally) and
wondering about the following piece of code which I was running under
W2K command-line:
print "First";
sleep 2;
print "Second";
I thought the script would print First then wait for 2 secon
, it figures, that when i added
fcntl(STDIN, F_SETFL, O_ASYNC|O_NONBLOCK);
sleep(5) stopped working right. It does not wait for 5 seconds
any longer, but actually for about 1/3 second and fully ignores
the sleep time a specify (you can run the server and connect to
it using telnet and see for
time and have server do
something usufull (like calculating something) i tried
handling SIGIO, so, when data is available on incoming
connection i handle and when there is no data, server
does its own job. However, it figures, that when i added
fcntl(STDIN, F_SETFL, O_ASYNC|O_NONBLOCK);
sleep(5
sleeping? Are you certain it's sleeping, or is it possible
it's blocking on a read or write?
> The code I am using to check the load average is this:
> $highload = ".8";
> while (($currload = &Load) > $highload)
>
> On Thu, Oct 03, 2002 at 10:10:34AM -0700, Jessee Parker wrote:
> > At the top of the loop, I check the system uptime to get the load
average
> > so I can have the program sleep for 5 seconds to let things stabilize a
> > bit.
>
> I suspect an easier way of doing thi
On Thu, Oct 03, 2002 at 10:10:34AM -0700, Jessee Parker wrote:
> At the top of the loop, I check the system uptime to get the load average
> so I can have the program sleep for 5 seconds to let things stabilize a
> bit.
I suspect an easier way of doing this would be to nice yourself do
I have a program that uses the Mail::Sender module that loops
through and gets the names and e-mail addresses out of a MySQL database. At
the top of the loop, I check the system uptime to get the load average so I
can have the program sleep for 5 seconds to let things stabilize a bit
> -Original Message-
> From: Chad Kellerman [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 12:37 PM
> To: [EMAIL PROTECTED]
> Subject: sleep question
>
>
> Greetings,
> I have a script that forks 5 children. I print to
> screen
Greetings,
I have a script that forks 5 children. I print to screen when each
child gets forked. Under certain conditions in the script a child
should sleep. This conditions occurs at different times for each child.
I think I am noticing that when the sleep is called in a child
gt; should be, perl will print out as fast as it can. Below code
> >
> > #!/usr/bin/perl -w
> >
> > $count = 1;
> >
> > while(1) {
> > $count++;
> > print "${count}\r";
> > }
> >
> > So? Great, right? Well, what i
should be, perl will print out as fast as it can. Below code
>
> #!/usr/bin/perl -w
>
> $count = 1;
>
> while(1) {
> $count++;
> print "${count}\r";
> }
>
> So? Great, right? Well, what if I want to slow if down with a sleep()
>
t;
> while(1) {
> $count++;
> print "${count}\r";
> }
>
> So? Great, right? Well, what if I want to slow if down with a sleep()
> statement?
>
> #!/usr/bin/perl -w
>
> $count = 1;
>
> while(1) {
> $count++;
> print "${cou
slow if down with a sleep()
statement?
#!/usr/bin/perl -w
$count = 1;
while(1) {
$count++;
print "${count}\r";
sleep(1);
}
>From what I have done using perl 5.4.x, I was able to do things like this.
But it seems that perl 5.6.0 will just sleep and not print anyt
Thank you to everyone for the help. I think the timer should be easy enough
to implement in perl. My concern was memory usage with the NT task scheduler
and would rather have perl do the chore.
At 06:52 PM 1/7/2002 +, Stout, Joel R wrote:
>I used to do this with NT Scheduler (if you have t
.xml' );
system ( 'perl newftp2.pl nor_card.xml' );
system ( 'perl newftp2.pl pet_card.xml' );
system ( 'perl newftp2.pl th_jua_card.xml' );
system ( 'perl newftp2.pl th_del_card.xml' );
sys
from this page, http://noc.nol.net/mirrors/mrtg/mrtg.html, which is an
archive of some sort of older versions of the mrtg web site. The current
page is www.mrtg.org.
$interval=300;
while (1) {
sleep( $interval - time() % $interval );
system 'c:\bin\perl c:\mrtg-2.7.4\run\mrtg c:\mrtg-
it would be best to have perl sleep for 5
minutes?
Thanks,
-Scott
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
solved the scheduling program by subtracting the
Lesli> "send time" from the "current time" giving me X seconds to wait. Then I use
Lesli> sleep($pause_length) before the next part of the program--mailing--executes.
Lesli> However, I also want the user to receive a Web
ving me X seconds to wait. Then I use
sleep($pause_length) before the next part of the program--mailing--executes.
However, I also want the user to receive a Web page that says, yeah, it
worked. When I run the program, everything does work, except that the
sleep() seems to invoke before the Web page is c
Time::HiRes is also good. It may be used for measuring time in msec
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
check the perl manpage for select.
/kk
On Wed, Aug 08, 2001 at 11:03:40AM -0700, EriK W wrote:
> How can I "sleep" and hundreds million seconds, shorter than 1 second?
>
> I want to have a short sleep which should be shorter than 1 second, it would
> be ideal if it can s
cc:
Subject: How can I "sleep" and hundreds
milliseconds, shorter than 1
08/08/01 02:03second?
How can I "sleep" and hundreds million seconds, shorter than 1 second?
I want to have a short sleep which should be shorter than 1 second, it would
be ideal if it can sleep for a radom short time between , say.. 300-800
milliseconds?
Thank you!
--
To unsubscribe, e-mail: [EMAIL
On Fri, 22 Jun 2001, Jerry Preston wrote:
> I have a perl cgi script that works great. I want to put it into and
> endless loop, put my problem is that my page keeps adding onto it's
> self. How do I redisplay the web screen without it adding on to it?
How are you doing this? You probably wan
Hi,
I have a perl cgi script that works great. I want to put it into and endless loop,
put my problem is that my page keeps adding onto it's self. How
do I redisplay the web screen without it adding on to it?
Thanks,
Jerry
Thank you. worked like a charm.
On Saturday 16 June 2001 12:52, Me wrote:
> > I am apparently missing something.
>
> Being aware of buffering, I suspect.
>
> Various parts of the 'pipe' between your print
> statements and the final destination do some
> sort of buffering. You can switch some of
> I am apparently missing something.
Being aware of buffering, I suspect.
Various parts of the 'pipe' between your print
statements and the final destination do some
sort of buffering. You can switch some of this
off in perl by specifying:
$| = 1;
pause one second,
do the 2 line returns, wait another second, then do all the printing
together. I obviously have something wrong, but don't know what.
Section of code:
sleep (1);
print "\n\nThe result is:";
sleep (1);
print "\n\nI was home alone. etc, etc.
--
Jim Gallot
76 matches
Mail list logo