in reply to Re^2: extracting from 1 file and adding to another.
in thread extracting from 1 file and adding to another.

Spot on for that ">" nudge. But I seem to missing the concept of it... I thought using >> was to add on to a file without overwriting. Didnt think it was necessary for the first file write. I still dont have it right but using that method atleast adds a bit more to my file.
  • Comment on Re^3: extracting from 1 file and adding to another.

Replies are listed 'Best First'.
Re^4: extracting from 1 file and adding to another.
by reisinge (Hermit) on Oct 19, 2013 at 12:52 UTC

    You probably don't want to open the file for each element of the @emails list.

    Well done is better than well said. -- Benjamin Franklin

      But even if you did want to open the file with each entry, I suspect you would want to close it with each entry, also.  openand closeare reciprocal functions; they should be used reciprocally.

      Of course, that would only enhance the inherent inefficiency of repeatedly opening the same file over and over again.  :-)

Re^4: extracting from 1 file and adding to another.
by Corion (Patriarch) on Oct 19, 2013 at 12:49 UTC

    What do you mean by "first file write"?

    Maybe you should really think about (or modify your program to output) how often your output file is opened.

      As in the first time I execute the program I expected the same data that the print to the screen showed, then if I was to run the program again but using the ">" I would of expected that to overwrite my first executions output.