A
ARIEL BOLUDOVSKY
Hello,
I want to open a file, find a string, modify it, and then close the file.
open(FH, "+< $path1") or die "Opening: $!";
@my_ARRAY = <FH>;
# change ARRAY here
seek(FH,0,0) or die "Seeking: $!";
print FH @my_ARRAY or die "Printing: $!";
truncate(FH,tell(FH)) or die "Truncating: $!";
close(FH);
Can anyone describe a quick method to find and modify a given pattern?
Thanks
ARIEL
I want to open a file, find a string, modify it, and then close the file.
open(FH, "+< $path1") or die "Opening: $!";
@my_ARRAY = <FH>;
# change ARRAY here
seek(FH,0,0) or die "Seeking: $!";
print FH @my_ARRAY or die "Printing: $!";
truncate(FH,tell(FH)) or die "Truncating: $!";
close(FH);
Can anyone describe a quick method to find and modify a given pattern?
Thanks
ARIEL