Miscellany
public text v1 · immutablemy $yes_no=my $add_line="";
sub yesno
{
$yes_no=uc($yes_no);
if (($yes_no ne "Y") || ($yes_no ne "YES"))
{
close (TESTFILE);
print "\nWrite operations complete - File closed\n";
exit 1;
}
}
open(TESTFILE, ">>$logfile")||die("unable to open file\n");
while (1)
{
print "Enter line of text to add : ";
$add_line=<STDIN>;
print TESTFILE $add_line;
print "Add another line? (Yes/No) :";
yesno(chomp($yes_no=<STDIN>));
}