Make sure IO::Handle is loaded - missing stubs on older perls
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / Statistics.pm
index 0248936..4894cf7 100644 (file)
@@ -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<DBIx::Class::Storage::Statistics> object.
 =head2 debugfh
 
 Sets or retrieves the filehandle used for trace/debug output.  This should
-be an IO::Handle compatible object (only the C<print> method is used). Initially
-should be set to STDERR - although see information on the
-L<DBIC_TRACE> environment variable.
+be an L<IO::Handle> 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<DBIC_TRACE|DBIx::Class::Storage/DBIC_TRACE> 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',
 );