<?xml version="1.0" encoding="windows-1252"?>
<node id="143528" title="Re: Re: File Input and Output" created="2002-02-05 21:10:44" updated="2005-07-28 20:06:29">
<type id="11">
note</type>
<author id="143302">
marlowe</author>
<data>
<field name="doctext">
&lt;CODE&gt;try this.

#!/usr/bin/perl -w

use strict;

my $output_file = "out.txt";
my $user_input = "";
my $quit_code = "quit\n";

open(OUTPUT, "&gt;$output_file) ||
   die "Unable to open $output_file for writing: $!\n";

while ($user_input ne $quit_code)
{
   print "Enter some text: ";
   $user_input = &lt;STDIN&gt;;
   print OUTPUT $user_input;
}

close(OUTPUT) ||
   die "Unable to close $output_file: $!\n; &lt;/CODE&gt;</field>
<field name="root_node">
960</field>
<field name="parent_node">
95793</field>
</data>
</node>
