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:
ortruncate $fh, 0; seek $fh, 0, 0; store_fd($data, \*$fh); close($fh);
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 |