in reply to Re^3: Is there a way to halt the program until an enter is pressed?
in thread Is there a way to halt the program until an enter is pressed?

It just waits without printing the print statement,I mean it is already expecting a user input without printing the print statement.\

print "Press <Enter> to continue, or 'q' to quit: "; my $input = <STDIN>; exit if $input eq "q\n";
  • Comment on Re^4: Is there a way to halt the program until an enter is pressed?
  • Download Code

Replies are listed 'Best First'.
Re^5: Is there a way to halt the program until an enter is pressed?
by GrandFather (Saint) on Mar 14, 2011 at 00:43 UTC

      Can you advise where should I set $| to 1,right before the print statement?

        I can, but I'm disinclined to acquiesce to your request. Go read the documentation I pointed you at or try it out in a test script (or both). Either way you'd have an answer before you received this reply.

        True laziness is hard work