in reply to Re: here document help
in thread here document help

Thanks for the reply

I tried to execute the command in the command prompt with an <Enter> after each statement and it is giving me the correct output with out hanging.

since I am new to this perl programming..can you tell me whether a script working from command prompt will hang when executed from perl script?

waiting for your valuable suggestions.

Srinivas.

Replies are listed 'Best First'.
Re^3: here document help
by Corion (Patriarch) on Apr 04, 2008 at 13:24 UTC

    Launching a shell interactively and manually entering the script line by line is different from launching a shell with a here-document.

    I recommend that you either launch the shell with the commands to execute separated by semicolons or that you write out a shell script and launch that shell script from Perl. Both ways are far easier to debug.

    Also, I'm not really sure whether your command line is correct. You should launch the shell with sh -c commands... and not sh comands... I think. But then, I avoid such trickery.