in reply to Re: Openind file for read+append
in thread Openind file for read+append

I'm having trouble matching strings in the file I'm opening. I just have it opening the file for reading now, because I"m trying to figure out what is going wrong. Is there something obvious that I am missing? It never matches the string on that file even though it IS there.

open FILE,'/Users/j/Desktop/test.log'; while (<FILE>) { chomp; #check for duplicate file if ($_ =~ m/appending/) { print "Looks like the data you entered is already on file\n"; close (FILE); } else { print "hey hey success\n"; close (FILE); &append; } }