in reply to Re^5: substitute on file line by line not working syntax error
in thread Search and Replace line by line not working on Filehandle
OK. Seems i have to use the "Seek thing". This seems to work:
Thanks#!/usr/bin/perl use strict; use warnings; open (IN, "+<C:/oracle/ora81/network/ADMIN/SQLNET.ORA") || die "cant o +pen $!"; my @file = <IN>; seek IN,0,0; foreach my $file (@file){ $file =~ s/^SQLNET\.AUTHENTICATION_SERVICES=\ \(NTS\)$/#\ SQLNET\.AUTH +ENTICATION_SERVICES=\ \(NTS\)/i; print IN $file; } close IN;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: substitute on file line by line not working syntax error
by cdarke (Prior) on Jan 15, 2010 at 11:28 UTC | |
by matze77 (Friar) on Jan 16, 2010 at 16:02 UTC |