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

Reply via email to