I tried to implement your suggestions.Even if I dont read anything from the read handle (just write the user name and reason to the write handle) even then program does not run.So problem cant be solved with changing input record separator.I am using PERL Version 5.8.3 which does not have Expect.pm .What else can I do with the current version for the script to run?