in reply to Re: writing to the top of a file
in thread writing to the top of a file

You've turned a conceptually simple process into fifteen overly-complicated steps.

When you think to use linked lists in Perl, you've probably overlooked a better way to do it using Perl's builtin features. Perl is so good at lists and hashes that you don't need a linked list - Perl's arrays can hold variable length elements, and can be manipulated much like linked lists.

And packed string headers are most definately only a good idea in C. Regards your variable length 'records', you'd be better off keeping an index in a separate file. Much less complexity, and you can just append to the end of both files.

But CPAN's Tie:: series of modules have probably already implemented the best solutions.

____________________
Jeremy
I didn't believe in evil until I dated it.