Jorge Goncalvez wrote: > Hi, I would like to parse a file and delete the entire line if it begins with > subnet. > How can I do this in Perl?
You can't - but you can write the lines-to-keep to a new temporary file - then unkink original and rename temporary files as necessary, something like ... open IN, "<$infile" or die $!; open OUT, "<$outfile" or die $!; while (<IN>) { next if /^subnet/; print OUT; } close OUT; close IN; unlink $infile or die $!; rename $outfile, $infile or die $!; -- Simon Oliver _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users