in reply to Perl File update
Try Tie::File. This can do everything you want. The doco has quite a few examples and here's a thread from yesterday with some more example code.
-- Ken