X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FADO.pm;h=4244aa787c5d9e8574684c4c463c5f42e3476b02;hb=74919a00766bc8f9bd9f6170d1977e186ce676d5;hp=705a59852a39ef5b61e9194ba12eec691a4b7956;hpb=9930caaf7e7c250d914cb1440d9a0f1dd2a1dedc;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/ADO.pm b/lib/DBIx/Class/Storage/DBI/ADO.pm index 705a598..4244aa7 100644 --- a/lib/DBIx/Class/Storage/DBI/ADO.pm +++ b/lib/DBIx/Class/Storage/DBI/ADO.pm @@ -8,6 +8,7 @@ use mro 'c3'; use Sub::Name; use Try::Tiny; +use DBIx::Class::_Util 'sigwarn_silencer'; use namespace::clean; =head1 NAME @@ -29,12 +30,9 @@ sub _rebless { shift->_determine_connector_driver('ADO') } sub _dbh_get_info { my $self = shift; - my $warn_handler = $SIG{__WARN__} || sub { warn @_ }; - - local $SIG{__WARN__} = sub { - $warn_handler->(@_) - unless $_[0] =~ m{^Missing argument in sprintf at \S+/ADO/GetInfo\.pm}; - }; + local $SIG{__WARN__} = sigwarn_silencer( + qr{^Missing argument in sprintf at \S+/ADO/GetInfo\.pm} + ); $self->next::method(@_); } @@ -52,11 +50,9 @@ sub _init { my $disconnect = *DBD::ADO::db::disconnect{CODE}; *DBD::ADO::db::disconnect = subname 'DBD::ADO::db::disconnect' => sub { - my $warn_handler = $SIG{__WARN__} || sub { warn @_ }; - local $SIG{__WARN__} = sub { - $warn_handler->(@_) - unless $_[0] =~ /Not a Win32::OLE object|uninitialized value/; - }; + local $SIG{__WARN__} = sigwarn_silencer( + qr/Not a Win32::OLE object|uninitialized value/ + ); $disconnect->(@_); }; } @@ -79,15 +75,19 @@ sub _init { # $sth; #} -1; - -=head1 AUTHOR +=head1 FURTHER QUESTIONS? -See L and L. +Check the list of L. -=head1 LICENSE +=head1 COPYRIGHT AND LICENSE -You may distribute this code under the same terms as Perl itself. +This module is free software L +by the L. You can +redistribute it and/or modify it under the same terms as the +L. =cut + +1; + # vim:sts=2 sw=2: