You could redirect STDIN to a pipe from within the script.
You could redirect STDIN to a pipe from outside the script.
perl wrapper.pl | perl game.pl
You could redirect STDIN to a buffer.
{ my $answers = "yes\nyes\n"; local *STDIN; open STDIN, '<', \$answers; # Requires Perl 5.8.0 askQuestions() }
You could tie STDIN.
- ikegami
In reply to Re: How do I automatically feed multiple yes'es into a subroutine that waits on reads from STDIN?
by Anonymous Monk
in thread How do I automatically feed multiple yes'es into a subroutine that waits on reads from STDIN?
by seank
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |