Re: The 2002 Perl Advent Calendar

2002-12-06 Thread robin szemeti
On Monday 02 December 2002 11:20, Tim Sweetman wrote: > > Mark Fowler wrote: > >> Doesn't December come round quickly? > >> > >> http://www.perladvent.org/2002/ > > Rght... > > so you use IO::AtomicFile, and ... at risk of being picky ... > 1. Its temporary filen

Re: IO::AtomicFile (was Re: The 2002 Perl Advent Calendar)

2002-12-02 Thread Nick Cleaton
On Mon, Dec 02, 2002 at 11:53:16AM +, Mark Fowler wrote: [SNIP] > my $fh = IO::AtomicFile->new("foo",">") > or die "Can't open 'foo': $!"; > > eval > { >print {$fh} $self->bar(); >print {$fh} $self->baz(); >print {$fh} $self->buzz(); >close $fh; > }; > > if ($@) >

Re: IO::AtomicFile (was Re: The 2002 Perl Advent Calendar)

2002-12-02 Thread Tim Sweetman
Mark, Mark Fowler wrote: eval { print {$fh} $self->bar(); print {$fh} $self->baz(); print {$fh} $self->buzz(); $fh->commit; close $fh; }; if ($@) { ... other error handling code ... } I can see how that would work. If I was the author I'd probably either put it as an option in the

IO::AtomicFile (was Re: The 2002 Perl Advent Calendar)

2002-12-02 Thread Mark Fowler
other error handling code ... } I can see how that would work. If I was the author I'd probably either put it as an option in the constructor, or write a subclass IO::AtomicFile::Explict that only moved when you called commit. Maybe you should email the author ([EMA

Re: The 2002 Perl Advent Calendar

2002-12-02 Thread Tim Sweetman
Mark Fowler wrote: Doesn't December come round quickly? http://www.perladvent.org/2002/ Rght... so you use IO::AtomicFile, and ... at risk of being picky ... 1. Its temporary filename doesn't incorporate anything random, or the process ID. So should you h

Re: The 2002 Perl Advent Calendar

2002-12-02 Thread Jonathan Peterson
Mark Fowler wrote: Doesn't December come round quickly? http://www.perladvent.org/2002/ Hey, that's cool :) -- Jonathan Peterson Technical Manager, Unified Ltd, +44 (0)20 7383 6092 [EMAIL PROTECTED]

The 2002 Perl Advent Calendar

2002-12-01 Thread Mark Fowler
e each day having it's own mini-tutorial attached, and much better html. Other features may be phased in during the Advent period. Hope everyone enjoys it. -- Mark Fowler http://www.twoshortplanks.com/ The 2002 Perl Advent Calendar [EMAIL PROTECTED]