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
In Section
Seekers of Perl Wisdom