CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Modifying .txt file



Jul 13, 2010, 8:54 PM

Post #1 of 3 (385 views)
Modifying .txt file Can't Post

I want to modify one text file, I don't want to make other it possible to make changes in the same file?..

If yes How?

Thank you..Wink

(This post was edited by tej.87g on Jul 13, 2010, 8:55 PM)


Jul 14, 2010, 2:06 AM

Post #2 of 3 (382 views)
Re: [tej.87g] Modifying .txt file [In reply to] Can't Post

(1) See the -i switch (perldoc perlrun), but it does not exactly fit your requirments (under the hood, it does make a new file, though you won't notice it).

(2) If you *know* what you are doing (for example, because though you are a beginner in Perl, you have experience in C), you can open the file using '+<' as open mode, and use sysread, syswrite, sysseek to process the file. Of course you have to take care about line endings by yourself.


Jul 14, 2010, 3:49 PM

Post #3 of 3 (373 views)
Re: [tej.87g] Modifying .txt file [In reply to] Can't Post

(3) Perl module Tie::File (


(This post was edited by Zhris on Jul 14, 2010, 3:50 PM)


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives