Thanks to everyone for the great input on my last question. Here's another. There has to be a better way to modify/delete lines in a file than this. my $filename = "thefile"; my $lineToDelete = "I'm a bad line, delete me."; open(FILE, "< $filename"); open(FILE_TMP, "> $filename.tmp"); while(<FILE>){ next if /$lineToDelete/; print FILE_TMP; } close(FILE); close(FILE_TMP); rename( "$filename.tmp", $filename); David
- Re: Modifying/Deleting lines in a file David Blevins
- Re: Modifying/Deleting lines in a file Brett W. McCoy
- Re: Modifying/Deleting lines in a file Timothy Kimball
- RE: Modifying/Deleting lines in a file David Blevins
- RE: Modifying/Deleting lines in a file Brett W. McCoy
- RE: Modifying/Deleting lines in a file Jeff Pinyan