Hi,
I am trying to open a file and correct the spelling of friend. But when I open the file test.txt again it is all blank.
my $opened = open(MYFH , ">test.txt");
my $line;
my $lnum = 1;
while( $line = <MYFH> ){
print "$lnum: $line\n";
$line =~ s/freind/friend/g;
print MYFH "$line";
$lnum++;
}
close MYFH;