RE: breakable loop???

2001-07-16 Thread Bradley M. Handy
; To: [EMAIL PROTECTED] > Subject: Re: breakable loop??? > > > Maybe I should try to rewrite my email in a more easy > to understand way, since no one is replying... > > I did the SIG{INT} thingie, and even had a die; > command at the end of it, but I can't break out of th

Re: breakable loop???

2001-07-14 Thread Thomas Jakub
Maybe I should try to rewrite my email in a more easy to understand way, since no one is replying... I did the SIG{INT} thingie, and even had a die; command at the end of it, but I can't break out of the function. Crtl + C does nothing. So, die; does make it so Crtl + C works, even if there is

Re: breakable loop???

2001-07-14 Thread Thomas Jakub
Maybe I should try to rewrite my email in a more easy to understand way, since no one is replying... I did the SIG{INT} thingie, and even had a die; command at the end of it, but I can't break out of the function. Crtl + C does nothing. So, die; does make it so Crtl + C works, even if there is

Re: breakable loop???

2001-07-14 Thread Thomas Jakub
Maybe I should try to rewrite my email in a more easy to understand way, since no one is replying... I did the SIG{INT} thingie, and even had a die; command at the end of it, but I can't break out of the function. Crtl + C does nothing. So, die; does make it so Crtl + C works, even if there is

Re: breakable loop???

2001-07-14 Thread Thomas Jakub
Maybe I should try to rewrite my email in a more easy to understand way, since no one is replying... I did the SIG{INT} thingie, and even had a die; command at the end of it, but I can't break out of the function. Crtl + C does nothing. So, die; does make it so Crtl + C works, even if there is

Re: breakable loop???

2001-07-14 Thread Thomas Jakub
Maybe I should try to rewrite my email in a more easy to understand way, since no one is replying... I did the SIG{INT} thingie, and even had a die; command at the end of it, but I can't break out of the function. Crtl + C does nothing. So, die; does make it so Crtl + C works, even if there is

Re: breakable loop???

2001-07-14 Thread Thomas Jakub
Maybe I should try to rewrite my email in a more easy to understand way, since no one is replying... I did the SIG{INT} thingie, and even had a die; command at the end of it, but I can't break out of the function. Crtl + C does nothing. So, die; does make it so Crtl + C works, even if there is

Re: breakable loop???

2001-07-14 Thread Thomas Jakub
Maybe I should try to rewrite my email in a more easy to understand way, since no one is replying... I did the SIG{INT} thingie, and even had a die; command at the end of it, but I can't break out of the function. Crtl + C does nothing. So, die; does make it so Crtl + C works, even if there is

Re: breakable loop???

2001-07-13 Thread Thomas Jakub
maybe I'm not implementing the SIG{ING} thingie right... I had a die; command in there, but that didn't work... --- Thomas Jakub <[EMAIL PROTECTED]> wrote: > Ummm... I can't seem to break out of my infinite > loops by doing crtl + c... consequently, I can't go > into the SIG{INT} function... I

Re: breakable loop???

2001-07-13 Thread Thomas Jakub
Ummm... I can't seem to break out of my infinite loops by doing crtl + c... consequently, I can't go into the SIG{INT} function... I tried Crtl + Backspace, but that didn't work to well either... Crtl + S stopped it, but that was it... What are the control signals for unix? Or am I doing som

Re: breakable loop???

2001-07-13 Thread Will Cottay
In this case, sub report_stats would only be called when the script gets a sigint. Be sure to read perlipc and pay attention to the warnings therein. I don't think this will work under Windows, but I'm pretty sure that Term::ReadKey will. Thomas Jakub wrote: > > signal handling sounds i

Re: breakable loop???

2001-07-12 Thread Thomas Jakub
Cool! I'll play around with this tommorrow when I'm less sleepy... --- David Labatte <[EMAIL PROTECTED]> wrote: > I did a quick search of CPAN and found that > Term::ReadKey should > be able to do exactly what you ask. I'm not sure > how platform > dependent it is, but I do remember using it on

Re: breakable loop???

2001-07-12 Thread Thomas Jakub
signal handling sounds interesting! I'll have to play around with that tommorow, along with Readkey! For signal handling, will it only go to the report_stats function if you kill it in some fashion, or will it go there when the program automatically ends? If it doesn't, I can just make the end

Re: breakable loop???

2001-07-12 Thread David Labatte
I did a quick search of CPAN and found that Term::ReadKey should be able to do exactly what you ask. I'm not sure how platform dependent it is, but I do remember using it once and having some problems with it under dos (but that was eon's ago and I can't remember exactly what I was trying to do [

Re: breakable loop???

2001-07-12 Thread Will Cottay
You might want to look at the CPAN module Term::ReadKey. It provides for non-blocking reads. Or, you could install a signal handler ie: $SIG{INT} = \&report_stats; while (1) { ... your website checking code here ... } sub report_stats { $SIG{QUIT} = \&report_stats; ...Your stat repor

Re: breakable loop???

2001-07-12 Thread Thomas Jakub
--- Adam Carson <[EMAIL PROTECTED]> wrote: > Since you said that you are trying to hit a > webserver until you tell it to stop, you might want > it to check for a different condition, such as a > certain number of hits or a timeout, etc. In Pascal > there is a getkey function, I don't think Perl

Re: breakable loop???

2001-07-12 Thread Adam Carson
Since you said that you are trying to hit a webserver until you tell it to stop, you might want it to check for a different condition, such as a certain number of hits or a timeout, etc. In Pascal there is a getkey function, I don't think Perl has an equivalent though.

Re: breakable loop???

2001-07-12 Thread Thomas Jakub
so... is their a function that won't wait for me to hit enter, and can still get the keys? Or rather, one that will read only once every time it goes through the while loop? --- Adam Carson <[EMAIL PROTECTED]> wrote: > Aaron, > If you read the rest of my post, I mention that > there is still

Re: breakable loop???

2001-07-12 Thread Thomas Jakub
--- Brett Davis <[EMAIL PROTECTED]> wrote: > This might be overkill - but you might try to use a > seperate thread and a > semaphore. Try looking at CPAN for the > documentation to the thread module. > > Brett I found the documentation okay, at http://theoryx5.uwinnipeg.ca/CPAN/data/perl/ext/

Re: breakable loop???

2001-07-12 Thread Aaron Craig
At 11:00 12.07.2001 -0400, Adam Carson wrote: >Aaron, > If you read the rest of my post, I mention that there is still a > problem with the code, ie the waiting for STDIN. I was just pointing out > one flaw in the streamlined version, as it seemed to be the better way to > go for that partic

Re: breakable loop???

2001-07-12 Thread Adam Carson
Aaron, If you read the rest of my post, I mention that there is still a problem with the code, ie the waiting for STDIN. I was just pointing out one flaw in the streamlined version, as it seemed to be the better way to go for that particular task. I too read the perldocs and saw the same th

Re: breakable loop???

2001-07-12 Thread Aaron Craig
At 13:36 11.07.2001 -0400, Adam Carson wrote: >--- Adam Carson <[EMAIL PROTECTED]> wrote: > > Gary, you forgot to make it: > > > > while (1) { # infinite loop > > my $c=getc; > > last if ord($c) == 10; # last itteration if $c > > numerically same as 10 > > print "blah\n"; > > } doesn't $c=g

Re: breakable loop???

2001-07-11 Thread Adam Carson
Thomas, Try checking the perldocs about getc(). There is some info there that might be useful. It also mentions checking CPAN. Adam Carson MIS Department Berkeley County, SC >>> Thomas Jakub <[

Re: breakable loop???

2001-07-11 Thread Thomas Jakub
--- Adam Carson <[EMAIL PROTECTED]> wrote: > Gary, you forgot to make it: > > while (1) { # infinite loop > my $c=getc; > last if ord($c) == 10; # last itteration if $c > numerically same as 10 > print "blah\n"; > } what does the my thingie do? Also, when I tried to run the code, it woul

Re: breakable loop???

2001-07-11 Thread Adam Carson
Gary, you forgot to make it: while (1) { # infinite loop my $c=getc; last if ord($c) == 10; # last itteration if $c numerically same as 10 print "blah\n"; } the ord() should be there like it was in Thomas' code. Not that it really solves anything, just a small bug.

RE: breakable loop???

2001-07-11 Thread Thomas Jakub
--- "Bradley M. Handy" <[EMAIL PROTECTED]> wrote: > > > > -Original Message- > > From: Thomas Jakub [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, July 11, 2001 11:43 AM > > To: [EMAIL PROTECTED] > > Subject: breakable loop??? > &

Re: breakable loop???

2001-07-11 Thread Gary Stainburn
Why don't you try the more perlish way of doing it while (1) { # infinite loop my $c=getc; last if $c == 10; # last itteration if $c numerically same as 10 print "blah\n"; } On Wednesday 11 July 2001 4:42 pm, Thomas Jakub wrote: > I have the following code segment: > > for ($count=1;$coun

RE: breakable loop???

2001-07-11 Thread Bradley M. Handy
> -Original Message- > From: Thomas Jakub [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 11, 2001 11:43 AM > To: [EMAIL PROTECTED] > Subject: breakable loop??? > > > I have the following code segment: > > for ($count=1;$count<11;$count++) > { >

breakable loop???

2001-07-11 Thread Thomas Jakub
I have the following code segment: for ($count=1;$count<11;$count++) { $c=getc; $count=1; print "blah\n"; if (ord($c) eq 10) { print "Stopping..." $count = 12; } } I'm trying to get it so it prints a bunch of "blah's" until I hit the enter key, at which point it will say that it is stopping. Ho