in reply to Storable or user bug?

That's because you're adding data to the end of the file. If you don't want to reopen file, just truncate it before invoking store_fd.

Update: alternatively just use store and it will rewrite file. So use one of these:

truncate $fh, 0; seek $fh, 0, 0; store_fd($data, \*$fh); close($fh);
or
store($data, $file); close $fh;

Replies are listed 'Best First'.
Re^2: Storable or user bug?
by duncs (Beadle) on Oct 16, 2009 at 08:24 UTC

    Thanks got it - thanks.

    I had tried the truncate, but that didn't work as expected as I didn't also do the seek...

    Duncs