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 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 something
> wrong, or what?
> 
> --- Will Cottay <[EMAIL PROTECTED]> wrote:
> > 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 reporting and exit code here
> > }
> > 
> > and hit ^C when you want it to report and stop.
> > 
> > 
> > 
> > Thomas Jakub wrote:
> > 
> > > --- 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
> > has
> > > > an equivalent though.
> > >
> > > I got it so it does it for as many iterations as
> > you
> > > specify, but I was hoping to get it so it could
> do
> > it
> > > continiously until someone hits enter.  Like,
> > maybe I
> > > could start it on Friday, sometime, without any
> > > concern for how many iterations it does per
> > second,
> > > and on monday, I can just hit enter to terminate
> > it,
> > > and get the run time statistics of it, thus far.
> 
> > Or
> > > maybe just do it until I need to reboot the
> > computer -
> > > I could just hit enter, and reboot...
> > > Anyhow, someone suggested that I do it with
> > threads...
> > >  how would I do this?
> > >
> > > >
> > > >                                   Adam Carson
> > > >                                 MIS Department
> > > >                              Berkeley County,
> SC
> > > >
> > > > >>> Thomas Jakub <[EMAIL PROTECTED]> 07/12/01
> > > > 02:20PM >>>
> > > > 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 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 thing. 
> In
> > > > fact,
> > > > > I suggested to Thomas that he check them
> > regarding
> > > > > just that problem.  That message also went
> to
> > the
> > > > > list.
> > > > >
> > > > >                      Regards,
> > > > >
> > > > >                                   Adam
> Carson
> > > > >                                 MIS
> Department
> > > > >                              Berkeley
> County,
> > SC
> > > > >
> > > > > >>> Aaron Craig <[EMAIL PROTECTED]>
> 07/12/01
> > > > > 04:59AM >>>
> > > > > 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=getc force the loop to wait for
> > input
> > > > > from STDIN?
> > > > >
> > > > > from perldoc
> > > > >
> > > > > getc FILEHANDLE
> > > > > getc
> > > > > Returns the next character from the input
> file
> > > > > attached to FILEHANDLE, or
> > > > > the undefined value at end of file, or if
> > there
> > > > was
> > > > > an error. If FILEHANDLE
> > > > > is omitted, reads from STDIN. This is not
> > > > > particularly efficient.
> > > > > ***However, it cannot be used by itself to
> > fetch
> > > > > single characters without
> > > > > waiting for the user to hit enter.****
> > > > >
> > > > > Aaron Craig
> > > > > Programming
> > > > > iSoftitler.com
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > __________________________________________________
> > > > Do You Yahoo!?
> > > > Get personalized email addresses from Yahoo!
> > Mail
> > > > http://personal.mail.yahoo.com/
> > > >
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Get personalized email addresses from Yahoo!
> Mail
> > > http://personal.mail.yahoo.com/
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to