Rajesh Dorairajan wrote:
> Does anyone know of a way to open a file in append mode and append on
> top of the file?

No, because that's not what "append mode" means. To insert data anywhere but
at the end, you have to rewrite the file contents from the point of
insertion forward. Or, you need to write the new data plus the old file
contents to a temporary file and then move it back over the old file.

Jose's Tie::File suggestion is probably the easiest way to go.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to