<?xml version="1.0" encoding="windows-1252"?>
<node id="999770" title="Pipping a script with prompts into less" created="2012-10-18 13:02:01" updated="2012-10-18 13:02:01">
<type id="115">
perlquestion</type>
<author id="80926">
xorl</author>
<data>
<field name="doctext">
I have this script that does something like:
&lt;code&gt;
my $foo = &lt;&gt;;
if ($foo eq "bar") {

} 
&lt;/code&gt;
Of course the script gives lots of output so when I run it, I want to pipe it into less
&lt;code&gt;
[/home/xorl]$ ./myscript.pl | less
&lt;/code&gt;
This is all well and good until the prompt happens.  Then there doesn't seem to be any way to get input to the script without quitting less.  However if I do that it kills the script too.

Is there a good way to handle a sistuation like this?  I tried also redirecting the output to a file, but that has a similar problem.  

&lt;P&gt;Edit: Also I'd like it to "work" if I don't pipe it into less as well.</field>
</data>
</node>
