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