Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    while( prompt "next: " ) {
      print "You said '$_'\n";
    }
    
  2. or download this
    $ cat > test.txt
    Hello
    ...
    $ cat test.txt | perl ./prompt.pl
    You said: Hello
    You said: World
    
  3. or download this
    use strict;
    use warnings;
    ...
    } else {
      print "piped\n";
    }
    
  4. or download this
    $ perl ./interactive.pl
    intereactive
    ...
    piped
    $ perl ./interactive.pl < test.txt
    piped