<?xml version="1.0" encoding="windows-1252"?>
<node id="1007362" title="using perl to &quot;press enter&quot;" created="2012-12-05 13:35:31" updated="2012-12-05 13:35:31">
<type id="115">
perlquestion</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
&lt;p&gt;I am not sure this is possible, but I want to somehow write to stdio or some such and make a perl script that will press enter on a timer. This is for a windows application that I have to mindlessly babysit. (and that I can't launch as a child process)

This is what I am using currently to tell me when to hit enter....
&lt;/p&gt;
&lt;code&gt;
while (true) {
   print"\n$t"
   $t=$t-1
   sleep(1);
   if($t&lt;0) {
      print "press enter NOW";
      #TODo - hit enter automagically
      $t = $timerlength; #reset
   }
}
&lt;/code&gt;
</field>
<field name="reputation">
8</field>
</data>
</node>
