delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/12/18/09:08:24

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3A3E1AF4.68305725@ece.gatech.edu>
Date: Mon, 18 Dec 2000 09:11:00 -0500
From: Charles Wilson <cwilson AT ece DOT gatech DOT edu>
X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
To: gerrit DOT haase AT t-online DOT de
CC: cygwin AT cygwin DOT com
Subject: Re: stdin/stdout with perl not o.k
References: <3A3E0DA5 DOT 5525 DOT 1E1BB716 AT localhost>

Your script works fine here.

~ > ./test.pl
Are you o.k?[yes/no] yes

fine...


cygutils perl-5.6.0
cygwin-1.1.6-1

--Chuck


"Gerrit P. Haase" wrote:
> 
> Hi there,
> 
> if i run this perl-script, i get no Output before i made an input at
> STDIN.
> The same in C is o.k.
> Anyone able to test it, because i don't know, whether it is a problem
> with my cygwin installation, with my perl installation or a problem
> with cygwin itself?
> 
> Thanks!
> 
> #!/usr/local/bin/perl
> # iocheck.pl
> print "Are you o.k?[yes/no] ";
> $input = <STDIN>;
> chomp $input;
> if ($input eq 'yes') {
>         print "\nfine...\n";
> } else {
>         print "\nohhh...\n";
> }
> 
> OUTPUT:
> $ io-check.pl
> yes
> Are you o.k?[yes/no]
> fine...
> 
> =========================================
> 
> The same in C is o.k.
> 
> =========================================
> /*
>  *IO-check
>  */
> #include <stdio.h>
> 
> int main(void) {
>   char ask[5];
>   int i;
> 
>   printf("\nAre you ok?[yes/no] ");
>   gets(ask);
>   printf("\n");
>   for (i=0;ask[i];i++)
>   {
>         if (ask[i]=='y')
>         {
>             puts("fine...\n");
>         }
>         else if (ask[i]=='n')
>         {
>             puts("ohhh...\n");
>         }
>   }
>   return 0;
> }
> 
> OUTPUT:
> $ iocheck.exe
> 
> Are you ok?[yes/no] yes
> 
> fine...
> 
> --
> =^..^=
> Gerrit Peter Haase
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019