in reply to Search and Replace line by line not working on Filehandle
use warnings; use strict; my $filename = 'C:/oracle/ora81/network/ADMIN/SQLNET.ORA'; open (my $in, '<', $filename) || die "Unable to open $filename:$!"; open (my $out,'>', "$filename.tmp") || die "Unable to open $filename.t +mp:$!"; while (<$in>) { # Identify the record if ($_ eq "SQLNET.AUTHENTICATION_SERVICES= (NTS)\n"){ $_ = '# '.$_; } print $out $_; } close $in; close $out; rename "$filename.tmp",$filename or die "Unable to rename: $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Search and Replace line by line not working on Filehandle
by matze77 (Friar) on Jan 15, 2010 at 13:24 UTC |