Re: printing content of a pipe

2013-06-28 Thread Shlomi Fish
Hi Rajeev, see below for some comments on your code. On Thu, 27 Jun 2013 15:07:50 -0700 (PDT) Rajeev Prasad rp.ne...@yahoo.com wrote: in the below code I am not able to print anything except whatever is in the $pty.  I want to print LINE_START: in the beginning of each line of the output,

Re: printing content of a pipe

2013-06-28 Thread *Shaji Kalidasan*
3:18 PM Subject: Re: printing content of a pipe Hi Rajeev, see below for some comments on your code. On Thu, 27 Jun 2013 15:07:50 -0700 (PDT) Rajeev Prasad rp.ne...@yahoo.com wrote: in the below code I am not able to print anything except whatever is in the $pty.  I want to print LINE_START

Re: printing content of a pipe

2013-06-28 Thread Rob Dixon
On 28/06/2013 02:32, Uri Guttman wrote: you don't need ever to set $| on stderr as it is not buffered like stdout is. and you rarely need to set it on stdout as any print with a \n will flush stdout. That isn't true. Perl will buffer STDOUT up to 8KB regardless of whether a newline has been

Re: printing content of a pipe

2013-06-28 Thread Shawn H Corey
On Fri, 28 Jun 2013 11:57:24 +0100 Rob Dixon rob.di...@gmx.com wrote: On 28/06/2013 02:32, Uri Guttman wrote: you don't need ever to set $| on stderr as it is not buffered like stdout is. and you rarely need to set it on stdout as any print with a \n will flush stdout. That isn't

Re: printing content of a pipe

2013-06-28 Thread shawn wilson
On Jun 28, 2013 9:24 AM, Shawn H Corey shawnhco...@gmail.com wrote: On Fri, 28 Jun 2013 11:57:24 +0100 Rob Dixon rob.di...@gmx.com wrote: On 28/06/2013 02:32, Uri Guttman wrote: you don't need ever to set $| on stderr as it is not buffered like stdout is. and you rarely need to

Re: printing content of a pipe

2013-06-28 Thread Rajeev Prasad
: Friday, June 28, 2013 4:48 AM Subject: Re: printing content of a pipe Hi Rajeev, see below for some comments on your code. On Thu, 27 Jun 2013 15:07:50 -0700 (PDT) Rajeev Prasad rp.ne...@yahoo.com wrote: in the below code I am not able to print anything except whatever is in the $pty.  I

Re: printing content of a pipe

2013-06-28 Thread Shlomi Fish
On Fri, 28 Jun 2013 07:37:57 -0700 (PDT) Rajeev Prasad rp.ne...@yahoo.com wrote: Shlomi/Uri, what do you mean by 'It's a good idea not to use select on filehandles like that because it willaffect the default filehandle permanently.'? SHELL shlomif@lap:~$ cat Test.pl #!/usr/bin/perl use

Re: printing content of a pipe

2013-06-28 Thread Rajeev Prasad
, June 28, 2013 11:45 AM Subject: Re: printing content of a pipe On Fri, 28 Jun 2013 07:37:57 -0700 (PDT) Rajeev Prasad rp.ne...@yahoo.com wrote: Shlomi/Uri, what do you mean by 'It's a good idea not to use select on filehandles like that because it willaffect the default filehandle

printing content of a pipe

2013-06-27 Thread Rajeev Prasad
in the below code I am not able to print anything except whatever is in the $pty.  I want to print LINE_START: in the beginning of each line of the output, but it does not print that, it only prints what the output of the exceuted command produced. why is that so?     while($pty) {          

Re: printing content of a pipe

2013-06-27 Thread Uri Guttman
On 06/27/2013 06:07 PM, Rajeev Prasad wrote: in the below code I am not able to print anything except whatever is in the $pty. I want to print LINE_START: in the beginning of each line of the output, but it does not print that, it only prints what the output of the exceuted command produced.