in reply to Editing a text file

It seems to me that bart and diotalevi have answered your question and the other users have provided you with some possible solutions. Now you should give it a shot and we will be happy to help once you show us some of what you have attempted and steer you in the right direction. You may want to check out the following nodes to get you started: How do I parse and evaluate a file line-by-line? or How do I read the contents of a file?.

Replies are listed 'Best First'.
Re^2: Editing a text file
by appletag (Initiate) on Nov 21, 2006 at 01:37 UTC
    I look forward to checking out the links you provided. I'm really enjoying this exercise. When a script has a print command in it, how can you send that to a file?
      When a script has a print command in it, how can you send that to a file?

      From inside the script, you can print to any file that's been opened for output just by specifying the filehandle in the print command, before the first argument:

      open SOMEFILE, '>', $filename; # Then... print SOMEFILE "Blah, blah, blah";

      Alternately, from outside the script, when calling it, most operating environments provide a way to redirect the standard output of the script to a file. For instance, in a POSIX-like environment you can use tee or a shell redirection operator (usually > in most Unix-style shells, and also in DOS, OS/2, and NT, among others). If you need more specific information about this, you'll have to specify more details about your operating environment.


      Sanity? Oh, yeah, I've got all kinds of sanity. In fact, I've developed whole new kinds of sanity. You can just call me "Mister Sanity". Why, I've got so much sanity it's driving me crazy.
        Thanks, The code everyone is submitting, some Google, and maybe a book and I think I'm closer to understanding perl. I'm really looking forward to all the cool things I should be able to do with some "Perl Wisdom".