Re: strange problem with STDIN- need help
- From: rcook@xxxxxxxxxxx (Owen Cook)
- Date: Thu, 29 Dec 2005 21:51:48 +1100 (EST)
On Thu, 29 Dec 2005, Poonam Pahil wrote:
> if($remove_CS =~ m/n/i ){ ??? }
> it does not reach to this point.
>
> it hangs before this, at
> my $remove_CS = <STDIN>;
>
>
Well this works for me
------------------------cut----------------------------
#!/usr/bin/perl -w
use strict;
print "Do you want to remove this CSpec(y/n):";
my $remove_CS = <STDIN>;
chop($remove_CS);
if($remove_CS =~ m/n/i ){print "\n\n OK - will not remove\n"} else {print
"\n\n OK - will remove\n"}
------------------------cut----------------------------
owen@ubuntu:~/Perlscripts$ perl -c stdin.pl
stdin.pl syntax OK
owen@ubuntu:~/Perlscripts$ perl stdin.pl
Do you want to remove this CSpec(y/n):n
OK - will not remove
owen@ubuntu:~/Perlscripts$ perl stdin.pl
Do you want to remove this CSpec(y/n):y
OK - will remove
owen@ubuntu:~/Perlscripts$
Owen
.
- References:
- Re: strange problem with STDIN- need help
- From: Poonam Pahil
- Re: strange problem with STDIN- need help
- Prev by Date: Re: strange problem with STDIN- need help
- Next by Date: Re: strange problem with STDIN- need help
- Previous by thread: Re: strange problem with STDIN- need help
- Next by thread: Re: strange problem with STDIN- need help
- Index(es):
Relevant Pages
|
|