Wait. Using this construct, I can't seem to get the change to write out to the file, like I can to stdout.
> > while (<IN>) { > if ( /^That_Text\s=\s2/ ) { > $_ .= $addText; > }else { > s/^This_Text.*$/That_Text = 2/; > } > You don't need the $_ since this is the default for regex searches and replaces. The line at ^shield remains untouched. The other lines modify the file just fine. Here's my code. sub editConfSettings { open (IN, "tmpconf") or die "cannot open for reading: $!\n"; open (OUT, "conf") or die "cannot open for writing: $!\n"; while (<IN>) { unless ($approve eq "none") { s/^attendant/attendant = $approves/g; } unless ($to eq "none") { s/^Appl.*$/Appl = $to/g; } unless ($shield eq "none") { chomp; $_ .= " :time=43.43\n" if (/^shield/); } print OUT $_; } close (IN); close (OUT); } What am I missing here? Should I do another s///g; ? d -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]