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


Reply via email to