then, I process the $o and print to STDOUT .
Now, the problem here is, when the data returned by the ssh is huge, then, the perl program hangs forever.
I did truss of the process id, it shows output like
read(3, 0x001DF90C, 5120) = 5120
---chunk of data from remote host ---
brk(0x001E2470) = 0
brk(0x001E2470) = 0
brk(0x001E4470) = 0
read(3, 0x001DF90C, 5120) = 5120
---chunk of data from remote host ---
---above continues until all data from rhost is read ---
---then starts write operation :
write(4, 0x00229D64, 5120) = 5120
---writes chunk of data read from rhost
---does for some more chunks then hangs forever---
write(4, 0x00229D64, 5120) (sleeping...)
## ##
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 8192
coredump(blocks) unlimited
nofiles(descriptors) 4096
vmemory(kbytes) unlimited