<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -34,12 +34,31 @@ send_to_denon(fromhex(&quot;ff fa 18 00&quot;,
                       &quot;ff f0&quot;,  # suboption end
                       ));
 
-expect_from_denon(&quot;BridgeCo AG Telnet server\x0a\x0d&quot;);
+# expect_from_denon(&quot;BridgeCo AG Telnet server\x0a\x0d&quot;);
 
-print &quot;Reading...\n&quot;;
-my $buf;
-while (sysread($sock, $buf, 300)) {
-    print &quot;Read: [&quot;, printable($buf), &quot;]\n&quot;;
+my $child = fork;
+unless (defined($child)) {
+    die &quot;Fork failure.&quot;;
+}
+
+if ($child) {
+    # we're the parent process.  accept input.
+    $| = 1;
+    while (1) {
+        print &quot;DENON&gt; &quot;;
+        my $line = &lt;STDIN&gt;;
+        chomp $line;
+        if (!$line) {
+            next;
+        }
+        send_to_denon($line . &quot;\x0d&quot;);
+    }
+} else {
+    # child process.
+    my $buf;
+    while (sysread($sock, $buf, 300)) {
+        print &quot;Read: [&quot;, printable($buf), &quot;]\n&quot;;
+    }
 }
 
 sub expect_from_denon {</diff>
      <filename>denon.pl</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3bca8ea8330420d299e1bdc984a862ad1af50af5</id>
    </parent>
  </parents>
  <author>
    <name>Brad Fitzpatrick</name>
    <email>brad@danga.com</email>
  </author>
  <url>http://github.com/bradfitz/perl-denon-avr-4806/commit/8cbeb66a2279e55d1e11727c9caea5158ccd1edf</url>
  <id>8cbeb66a2279e55d1e11727c9caea5158ccd1edf</id>
  <committed-date>2008-11-27T14:11:23-08:00</committed-date>
  <authored-date>2008-11-27T14:11:23-08:00</authored-date>
  <message>input loop, reading in child process</message>
  <tree>bbd781e0739c2b94fd551e34106bbf66db6b5954</tree>
  <committer>
    <name>Brad Fitzpatrick</name>
    <email>brad@danga.com</email>
  </committer>
</commit>
