Sep 15, 2011, 3:34 AM
Post #2 of 2
Re: [q1w2e3] File handeling to make multiple files: help needed urgently
[In reply to]
having file handler PO.
I guess you mean file handle, not file handler. A file handler is something different.
As for your question: To use your output file later on as an input file, you have two options to choose from:
- Close the output file, then reopen it as input file.
- Initially create the output file for "read and write", and use the tell()/seek() functions to reposition the file pointer.
BTW, I suggest that you use a localized variable as a file handle, instead of a global handle, i.e.
open(my $po, ...)
This is not so important in your small example code, but can make things easier when your code gets more complicated.