<?xml version="1.0" encoding="windows-1252"?>
<node id="929360" title="Re: Testing &lt;&gt;" created="2011-10-03 11:25:27" updated="2011-10-03 11:25:27">
<type id="11">
note</type>
<author id="712372">
kennethk</author>
<data>
<field name="doctext">
You can detect the presence of waiting input using [doc://select], like:
&lt;c&gt;use strict;
use warnings;

my $vector = '';
vec($vector,fileno(STDIN),1) = 1;
if (select($vector,undef,undef,0.01)) {
    while (&lt;&gt;) {
        print;
    }
}&lt;/c&gt;
&lt;p&gt;where I have set a 10 millisecond timeout.  Might be easier and more portable though to simply pass the filename as argument, and [doc://open] it yourself.  Like many other unix command line tools. </field>
<field name="root_node">
929359</field>
<field name="parent_node">
929359</field>
</data>
</node>
