X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FStatistics.pm;h=4894cf7c2021aa4b155b07dca149f1792811b3ae;hb=4d93345c2f06a03076dcb43cb256de5c973c203b;hp=0248936ec0f99f4df5cd50f0ccc0cfc669e41882;hpb=68b8ba54e535ba5e68e044b3bedec73b20500b72;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/Statistics.pm b/lib/DBIx/Class/Storage/Statistics.pm index 0248936..4894cf7 100644 --- a/lib/DBIx/Class/Storage/Statistics.pm +++ b/lib/DBIx/Class/Storage/Statistics.pm @@ -1,21 +1,21 @@ package DBIx::Class::Storage::Statistics; + use strict; use warnings; # DO NOT edit away without talking to riba first, he will just put it back # BEGIN pre-Moo2 import block BEGIN { - require warnings; my $initial_fatal_bits = (${^WARNING_BITS}||'') & $warnings::DeadBits{all}; local $ENV{PERL_STRICTURES_EXTRA} = 0; require Moo; Moo->import; - require Sub::Quote; Sub::Quote->import('quote_sub'); ${^WARNING_BITS} &= ( $initial_fatal_bits | ~ $warnings::DeadBits{all} ); } # END pre-Moo2 import block extends 'DBIx::Class'; -use DBIx::Class::_Util 'sigwarn_silencer'; +use DBIx::Class::_Util qw(sigwarn_silencer qsub); +use IO::Handle (); use namespace::clean; =head1 NAME @@ -43,11 +43,13 @@ Returns a new L object. =head2 debugfh Sets or retrieves the filehandle used for trace/debug output. This should -be an IO::Handle compatible object (only the C method is used). Initially -should be set to STDERR - although see information on the -L environment variable. +be an L compatible object (only the +L<< printflush|IO::Handle/$io->printflush_(_ARGS_) >> method is used). By +default it is initially set to STDERR - although see discussion of the +L environment variable. -As getter it will lazily open a filehandle for you if one is not already set. +Invoked as a getter it will lazily open a filehandle for you if one is not +already set. =cut @@ -64,7 +66,7 @@ sub debugfh { has _debugfh => ( is => 'rw', lazy => 1, - trigger => quote_sub( '$_[0]->_defaulted_to_stderr(undef)' ), + trigger => qsub '$_[0]->_defaulted_to_stderr(undef)', builder => '_build_debugfh', );