Click here to get back home

Tie::YAML doesn't write to tmp file first?

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Tie::YAML doesn't write to tmp file first? Robert Nicholson 12-23-2007
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.


Similar ThreadsPosted
How to tie with YAML but also have flock support? December 23, 2007, 9:11 am
Output binary data in base64 in YAML January 14, 2005, 7:20 pm
reading array data back into perl with YAML December 1, 2005, 2:22 pm
SerialPort write question October 28, 2004, 11:52 am
How to write into existing Excel Spreadsheets? July 13, 2004, 1:24 pm
Can I write Macros in excel workbook ? October 8, 2004, 7:50 am
I don't want to write an HTML templating module August 30, 2007, 5:27 am
write a new module for suffix trees? April 3, 2008, 5:12 pm
write permissions installing XML-SAX-Expat-0.38 locally June 9, 2007, 10:44 am
SpreadSheet::Write Excel- Is there a way to set background color for entire worksheet? January 21, 2005, 12:56 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap