- or download this
my $hosts = "C:/windows/system32/drivers/etc/hosts";
...
open FILE, ">$hosts" or die "Can't write $hosts $!\n";
print FILE "127.0.0.1 localhost\n$line";
close FILE;
- or download this
my $hosts = "C:/windows/system32/drivers/etc/hosts";
...
print OUT $line; # add the new record
close IN;
close OUT;
- or download this
$old =~ s/\Q$old_ip\s+/$new_ip /;
print OUT $old;
- or download this
C:\>perl -pi.bak -e "s/this/that/g" <file>