in reply to Is it possible to write to STDIN ?
$ foo | bar
'bar's STDIN is whatever 'foo' spits to STDOUT. So if you can control how your code is executed from the shell, you can control its STDIN. For example ...
will execute your script ten times, each time with a different number on its STDIN.for i in `seq 1 10`; do echo $i|./myscript.pl; done
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Is it possible to write to STDIN ?
by exilepanda (Friar) on Jul 21, 2014 at 15:18 UTC | |
by DrHyde (Prior) on Jul 23, 2014 at 10:31 UTC |
In Section
Seekers of Perl Wisdom