You will open a file like this ...
To search and replace you probably want to use regex stuff since it's the most powerfull and the simplest ...Code:open FILE, ">>/pathto/file";
orCode:s/replace/me/;
There are a few diffrent ways you can write back to the file. You could read the whole file in and do changes and then write it out, or attempt to change out line by line. I would probably choose the first way since it is easier to code and much simpler to bug fix.Code:$scalar =~ s/replace/me/;
To print to a file all yu have to do is print to a filehandle ...
Check out http://www.perlmonks.org as well as you might find the answer there.Code:print $stuff FILE;


Reply With Quote
Bookmarks