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

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";
  • Comment on Re^8: Is there a way to halt the program until an enter is pressed?
  • Download Code

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

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

    True laziness is hard work
Re^9: Is there a way to halt the program until an enter is pressed?
by Anonymous Monk on Mar 14, 2011 at 01:10 UTC

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