hey i got the issue i was giving Ctrl+Z then followed by some other commands. may be that caused the problem..now it works fine ..
Also when i tried to run the perl script not from the command prompt directly from the perl for ex: the code
#!/usr/local/bin/perl -w
@lines= <STDIN>;
print "@lines";
print"This is new \n";
i saved it as input.pl and when i clicked on that from the folder the prompt window was shown i was able to give the inputs and when i pressed Ctrl+Z the window was closed without showing the "This is new" text.
How can i make my prompt window stay.