I am appending information to a text file and want to do this until exit is entered as a string.
This is what I used but ‘exit’ does not want to exit the loop.
print "please input info to write to the file\n";
my $input = <STDIN>;
until($input =~ /exit/)
{
open MYFILE, ">>information.txt" or die "$!";
print MYFILE "$input";
print "enter 'exit' to exitor add more info\n";
my $input = <STDIN>;
}
You are making a few mistakes here, but as parapura said, only one causes this particular bug.