We don't bite newbies here... much | |
PerlMonks |
(atl) RE: Inserting stuff into a filehandle.by atl (Pilgrim) |
on Aug 09, 2000 at 14:53 UTC ( [id://27005]=note: print w/replies, xml ) | Need Help?? |
That might depend on the operating system (at least
I think that some old OSes with structured files types
could behave totally different from Unix/Win). General remark: it is good idea to state the OS and Perl version (including used modules) if you ask a question. If you are using some sort of Unix, the answer is: no. You can seek any position inside the file, but if you write, you overwrite. Now, the question is, what do you want to do? If you generate some output (say, dynamic HTML) you might just buffer it into variables and write it out in one go. If your intermediate results have to be persistent (i.e. written to disk), you might consider storing them in seperate files and build your final file as needed. (Might be a good idea anyway, 'cause you don't manipulate earlier results which makes debugging easier.) If that is no option, too, I'm afraid you got to go with the tmp-file solution proposed by the other monks. Hope that helps a bit ... Andreas UPDATE:Merlyn pointed to the faq section on this topic when answering a similar question. I looked it up and there is a description on how to do it with temporary files: look here. Aaah, resourceful monastry ;-))
In Section
Seekers of Perl Wisdom
|
|