in reply to Re^5: 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?

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

  • Comment on Re^6: Is there a way to halt the program until an enter is pressed?

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

    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

      If I do a test script,the script looks fine,it waits after the print statement,confused :-(

      use strict; use warnings; print "\nTest1\n"; print "\nTest2\n"; print "Press <Enter> to continue, or 'q' to quit: "; my $user_input = <STDIN>; exit if $user_input eq "q\n";

        Figured it out ,just setted the variable ,it works- Thanks!

        I'm confused: I can't see where you set $|.

        True laziness is hard work