Re: strange problem with STDIN- need help
- From: poonam.pahil@xxxxxxxxx (Poonam Pahil)
- Date: Fri, 30 Dec 2005 13:59:55 +0530
i managed to figure out the cause.
i was undefining $/ .I wanted to use slurping technique.i.e reading in a
small file in a variable & then making the changes.
Ive now undefined this within a local context.
Its working fine now.
anyone has an idea how this is affecting <STDIN>.
I tried using $|=1 but that did not help.
Thanks
Poonam
On 12/29/05, Timothy Johnson <tjohnson@xxxxxxxxxxxxxxxxxxx> wrote:
>
>
> Try adding this line to the top of your script:
>
> $| = 1;
>
> This sets STDOUT to autoflush the buffer. You may be trying to print
> something that just isn't showing up.
>
> -----Original Message-----
> From: Poonam Pahil [mailto:poonam.pahil@xxxxxxxxx]
> Sent: Thursday, December 29, 2005 2:23 AM
> To: beginners@xxxxxxxx
> Subject: strange problem with STDIN- need help
>
> Hi,
>
> Iam using <STDIN> to accept user input but the script just hangs at that
> point.
> I type in the value & program is just stuck at that point.
>
> i know its got to do with buffer flushing. when iam using the same piece
> of
> code at the beginning of the script everything works fine.
>
> iam using system() a lot. directing input/output to/from files. can this
> be
> the reason.
>
> This is the piece of code:
>
> print "Do you want to remove this CSpec(y/n):";
> my $remove_CS = <STDIN>;
> chop($remove_CS);
> if($remove_CS =~ m/n/i )
>
> Thanks & Regards
> Poonam
>
>
- Follow-Ups:
- Re: strange problem with STDIN- need help
- From: John W. Krahn
- Re: strange problem with STDIN- need help
- References:
- RE: strange problem with STDIN- need help
- From: Timothy Johnson
- RE: strange problem with STDIN- need help
- Prev by Date: Plotting a 2D chart
- 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
|