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