X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FStatistics.pm;h=f5216583285ef8e0b3c4cfb07bffa31a145f24b8;hb=02562a2092543488bba4ccd98c39abca72560555;hp=42137bfdcb374c5730c5978aa3546ca59a4336b0;hpb=0020e364ef2847a723dd8bc538ee1ce632fd734c;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/Statistics.pm b/lib/DBIx/Class/Storage/Statistics.pm index 42137bf..f521658 100644 --- a/lib/DBIx/Class/Storage/Statistics.pm +++ b/lib/DBIx/Class/Storage/Statistics.pm @@ -45,20 +45,11 @@ already set). =cut -# FIXME - there ought to be a way to fold this into _debugfh itself -# having the undef re-trigger the builder (or better yet a default -# which can be folded in as a qsub) -sub debugfh { - my $self = shift; - - return $self->_debugfh(@_) if @_; - $self->_debugfh || $self->_build_debugfh; -} - -has _debugfh => ( +has debugfh => ( is => 'rw', lazy => 1, - trigger => qsub '$_[0]->_defaulted_to_stderr(undef)', + trigger => qsub '$_[0]->_defaulted_to_stderr(undef); $_[0]->_clear_debugfh unless $_[1];', + clearer => '_clear_debugfh', builder => '_build_debugfh', );