Unrelated to Perl, filesystems typically don't provide functionality for that to happen transparently. What you need to do is read out the old file content into memory, insert the new data at the beginning (Perl's scalars or arrays are offering this in a nice transparent way) and then write the whole blob back to disk.
In reply to Re: writing to the top of a file
by saintmike
in thread writing to the top of a file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |