|
Posted by Robert Nicholson on December 23, 2007, 9:34 am
Please log in for more thread options
So the save method looks like this
sub save{
my $self = shift;
my $filename = $self->filename;
open my $fh, ">:raw", $filename or croak "$filename: $!";
print $fh Dump(damn_scalar($self));
close $fh;
return 1;
}
That means that if it's interrupted during save you've lost your
original file.
Instead of doing that it should be writing to a temporary file first
and then renaming
it later.
|