--- 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 would only acknoledge the other key
presses when I hit enter.  So, the only way I could
have any output is to hit the space bar 15 times, and
then enter, which would terminate the program.  How
could I make it so blah would be printed on the screen
constantly, until I hit enter?  The way it does it,
right now, is that it prints as many blah's as non
enter keys I hit before hand.  I want it so it would
do blah for an infinite ammount of time, until I hit
enter.  
What I'm trying to do with this, ultimatly, is modify
PagePoker1.2, a load testing tool I found online, to
keep on "hitting" a webserver until I tell it to stop,
and that when I tell it to stop, it'll display the
statistics, like how many things have been done, etc,
thus far.

> the ord() should be there like it was in Thomas'
> code.
> Not that it really solves anything, just a small
> bug.
> 
>                                   Adam Carson
>                                 MIS Department
>                              Berkeley County, SC
> 
> >>> Gary Stainburn <[EMAIL PROTECTED]>
> 07/11/01 12:16PM >>>
> 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;$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.  However, when I run this
> piece
> > of code, it says only one blah, and even then, it
> is
> > after I hit enter...  So, what am I doing wrong?
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get personalized email addresses from Yahoo! Mail
> > http://personal.mail.yahoo.com/ 
> 
> -- 
> Gary Stainburn
>  
> This email does not contain private or confidential
> material as it
> may be snooped on by interested government parties
> for unknown
> and undisclosed purposes - Regulation of
> Investigatory Powers Act, 2000     
> 


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

Reply via email to