From: Dagfinn Ilmari Mannsåker Date: Tue, 27 Jun 2017 12:16:31 +0000 (+0100) Subject: Attempt to fix 'Attempt to free unreferenced scalar' on 5.8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fnamespace-cleanup;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Attempt to fix 'Attempt to free unreferenced scalar' on 5.8 Move 'use namespace::clean' to after all the other use statements, and remove now-pointless empty import lists. --- diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 9103faf..e9e6a58 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -16,9 +16,8 @@ use Lingua::EN::Inflect::Number (); use Lingua::EN::Inflect::Phrase (); use String::ToIdentifier::EN (); use String::ToIdentifier::EN::Unicode (); -use File::Temp (); use Class::Unload; -use Class::Inspector (); +use Class::Inspector; use Scalar::Util 'looks_like_number'; use DBIx::Class::Schema::Loader::Column; use DBIx::Class::Schema::Loader::Utils qw/split_name dumper_squashed eval_package_without_redefine_warnings class_path slurp_file sigwarn_silencer firstidx uniq/; @@ -27,7 +26,8 @@ use Try::Tiny; use DBIx::Class (); use Encode qw/encode decode/; use List::Util qw/all any none/; -use File::Temp 'tempfile'; +use File::Temp qw/tempfile tempdir/; + use namespace::clean; our $VERSION = '0.07047'; @@ -1208,10 +1208,10 @@ sub new { croak "dry_run can only be used with static schema generation" if $self->dynamic and $self->dry_run; - $self->{temp_directory} ||= File::Temp::tempdir( 'dbicXXXX', - TMPDIR => 1, - CLEANUP => 1, - ); + $self->{temp_directory} ||= tempdir( 'dbicXXXX', + TMPDIR => 1, + CLEANUP => 1, + ); $self->{dump_directory} ||= $self->{temp_directory}; diff --git a/lib/DBIx/Class/Schema/Loader/DBI.pm b/lib/DBIx/Class/Schema/Loader/DBI.pm index 034061f..67687e8 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI.pm @@ -7,8 +7,8 @@ use mro 'c3'; use Try::Tiny; use List::Util 'any'; use Carp::Clan qw/^DBIx::Class/; -use namespace::clean; use DBIx::Class::Schema::Loader::Table (); +use namespace::clean; our $VERSION = '0.07047'; diff --git a/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm b/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm index 9de0e70..4f7b4c6 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm @@ -7,11 +7,9 @@ use base qw/ DBIx::Class::Schema::Loader::DBI /; use mro 'c3'; - use List::Util 'any'; -use namespace::clean; - use DBIx::Class::Schema::Loader::Table (); +use namespace::clean; our $VERSION = '0.07047'; diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Informix.pm b/lib/DBIx/Class/Schema/Loader/DBI/Informix.pm index 6820dc3..8c252a9 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Informix.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Informix.pm @@ -7,8 +7,8 @@ use mro 'c3'; use Scalar::Util 'looks_like_number'; use List::Util 'any'; use Try::Tiny; -use namespace::clean; use DBIx::Class::Schema::Loader::Table::Informix (); +use namespace::clean; our $VERSION = '0.07047'; diff --git a/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm b/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm index 8329f6a..5b496fc 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm @@ -6,8 +6,8 @@ use base qw/DBIx::Class::Schema::Loader::DBI/; use mro 'c3'; use Carp::Clan qw/^DBIx::Class/; use List::Util 'first'; -use namespace::clean; use DBIx::Class::Schema::Loader::Table (); +use namespace::clean; our $VERSION = '0.07047'; diff --git a/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm b/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm index e2810f2..0cbb30b 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm @@ -6,9 +6,8 @@ use base 'DBIx::Class::Schema::Loader::DBI::Sybase::Common'; use mro 'c3'; use Try::Tiny; use List::Util 'any'; -use namespace::clean; - use DBIx::Class::Schema::Loader::Table::Sybase (); +use namespace::clean; our $VERSION = '0.07047'; diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ODBC/ACCESS.pm b/lib/DBIx/Class/Schema/Loader/DBI/ODBC/ACCESS.pm index 331a7a1..eebbd22 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ODBC/ACCESS.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ODBC/ACCESS.pm @@ -5,8 +5,8 @@ use warnings; use base 'DBIx::Class::Schema::Loader::DBI::ODBC'; use mro 'c3'; use Try::Tiny; -use namespace::clean; use DBIx::Class::Schema::Loader::Table (); +use namespace::clean; our $VERSION = '0.07047'; diff --git a/lib/DBIx/Class/Schema/Loader/DBI/SQLAnywhere.pm b/lib/DBIx/Class/Schema/Loader/DBI/SQLAnywhere.pm index 72cbdfd..1b3bf9b 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/SQLAnywhere.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/SQLAnywhere.pm @@ -5,8 +5,8 @@ use warnings; use base 'DBIx::Class::Schema::Loader::DBI::Component::QuotedDefault'; use mro 'c3'; use List::Util 'any'; -use namespace::clean; use DBIx::Class::Schema::Loader::Table (); +use namespace::clean; our $VERSION = '0.07047'; diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm b/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm index 94b1b68..7cecc41 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm @@ -5,9 +5,8 @@ use warnings; use base 'DBIx::Class::Schema::Loader::DBI::Sybase::Common'; use mro 'c3'; use List::Util 'any'; -use namespace::clean; - use DBIx::Class::Schema::Loader::Table::Sybase (); +use namespace::clean; our $VERSION = '0.07047'; diff --git a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm index 2af0178..0438bff 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm @@ -9,8 +9,8 @@ use List::Util qw/any first/; use Try::Tiny; use Scalar::Util 'blessed'; use DBIx::Class::Schema::Loader::Utils qw/sigwarn_silencer/; -use namespace::clean; use DBIx::Class::Schema::Loader::Table (); +use namespace::clean; our $VERSION = '0.07047'; diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm index 5fce82c..413c959 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm @@ -9,13 +9,13 @@ use Scalar::Util 'weaken'; use DBIx::Class::Schema::Loader::Utils qw/split_name slurp_file array_eq apply uniq/; use Try::Tiny; use List::Util qw/all any first/; -use namespace::clean; -use Lingua::EN::Inflect::Phrase (); -use Lingua::EN::Tagger (); +use Lingua::EN::Inflect::Phrase qw(to_PL to_S); +use Lingua::EN::Tagger; use String::ToIdentifier::EN (); use String::ToIdentifier::EN::Unicode (); -use Class::Unload (); -use Class::Inspector (); +use Class::Unload; +use Class::Inspector; +use namespace::clean; our $VERSION = '0.07047'; @@ -218,7 +218,7 @@ sub _to_PL { my ($self, $name) = @_; $name =~ s/_/ /g; - my $plural = Lingua::EN::Inflect::Phrase::to_PL($name); + my $plural = to_PL($name); $plural =~ s/ /_/g; return $plural; @@ -228,7 +228,7 @@ sub _to_S { my ($self, $name) = @_; $name =~ s/_/ /g; - my $singular = Lingua::EN::Inflect::Phrase::to_S($name); + my $singular = to_S($name); $singular =~ s/ /_/g; return $singular; diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_05.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_05.pm index 9e932d6..7749dc6 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_05.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_05.pm @@ -5,8 +5,8 @@ use warnings; use base 'DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_06'; use mro 'c3'; use DBIx::Class::Schema::Loader::Utils 'array_eq'; -use namespace::clean; use Lingua::EN::Inflect::Number (); +use namespace::clean; our $VERSION = '0.07047'; diff --git a/lib/DBIx/Class/Schema/Loader/Utils.pm b/lib/DBIx/Class/Schema/Loader/Utils.pm index 4fc5fb6..fb25187 100644 --- a/lib/DBIx/Class/Schema/Loader/Utils.pm +++ b/lib/DBIx/Class/Schema/Loader/Utils.pm @@ -7,9 +7,10 @@ use Test::More; use String::CamelCase 'wordsplit'; use Carp::Clan qw/^DBIx::Class/; use List::Util 'all'; -use namespace::clean; -use Exporter 'import'; use Data::Dumper (); +use base 'Exporter'; +use namespace::clean; + our @EXPORT_OK = qw/split_name dumper dumper_squashed eval_package_without_redefine_warnings class_path no_warnings warnings_exist warnings_exist_silent slurp_file write_file array_eq sigwarn_silencer apply firstidx uniq/; diff --git a/script/dbicdump b/script/dbicdump index 80ade35..5c72419 100644 --- a/script/dbicdump +++ b/script/dbicdump @@ -101,7 +101,6 @@ use warnings; use Getopt::Long; use Pod::Usage; use DBIx::Class::Schema::Loader 'make_schema_at'; -use namespace::clean; use DBIx::Class::Schema::Loader::Base (); use DBIx::Class::Schema::Loader::Optional::Dependencies (); require lib; diff --git a/t/10_03pg_common.t b/t/10_03pg_common.t index b1ab020..85cd8e4 100644 --- a/t/10_03pg_common.t +++ b/t/10_03pg_common.t @@ -10,7 +10,6 @@ use Test::More; use Test::Exception; use Try::Tiny; use File::Path 'rmtree'; -use namespace::clean; use lib qw(t/lib); use dbixcsl_common_tests (); diff --git a/t/10_05ora_common.t b/t/10_05ora_common.t index c63f9e3..ae43965 100644 --- a/t/10_05ora_common.t +++ b/t/10_05ora_common.t @@ -10,7 +10,6 @@ use DBIx::Class::Schema::Loader::Utils qw/slurp_file split_name/; use Try::Tiny; use File::Path 'rmtree'; use String::ToIdentifier::EN::Unicode 'to_identifier'; -use namespace::clean; use lib qw(t/lib); use dbixcsl_common_tests (); diff --git a/t/10_06sybase_common.t b/t/10_06sybase_common.t index d19b7b7..88b1851 100644 --- a/t/10_06sybase_common.t +++ b/t/10_06sybase_common.t @@ -9,7 +9,6 @@ use Try::Tiny; use File::Path 'rmtree'; use DBIx::Class::Schema::Loader 'make_schema_at'; use DBIx::Class::Schema::Loader::Utils qw/sigwarn_silencer/; -use namespace::clean; use DBI (); use lib qw(t/lib); diff --git a/t/10_07mssql_common.t b/t/10_07mssql_common.t index 4bf8721..38d6d81 100644 --- a/t/10_07mssql_common.t +++ b/t/10_07mssql_common.t @@ -7,7 +7,6 @@ use DBIx::Class::Schema::Loader::Utils qw/warnings_exist_silent sigwarn_silencer use Try::Tiny; use File::Path 'rmtree'; use DBIx::Class::Schema::Loader 'make_schema_at'; -use namespace::clean; use Scope::Guard (); # use this if you keep a copy of DBD::Sybase linked to FreeTDS somewhere else diff --git a/t/10_10informix_common.t b/t/10_10informix_common.t index 6ebd0a2..89497fe 100644 --- a/t/10_10informix_common.t +++ b/t/10_10informix_common.t @@ -10,7 +10,6 @@ use File::Path 'rmtree'; use DBIx::Class::Schema::Loader 'make_schema_at'; use DBIx::Class::Schema::Loader::Utils 'split_name'; use String::ToIdentifier::EN::Unicode 'to_identifier'; -use namespace::clean; use lib qw(t/lib); diff --git a/t/23dumpmore.t b/t/23dumpmore.t index 82c731d..dacaef6 100644 --- a/t/23dumpmore.t +++ b/t/23dumpmore.t @@ -2,10 +2,10 @@ use strict; use warnings; use Test::More; use DBIx::Class::Schema::Loader::Utils qw/slurp_file write_file/; -use namespace::clean; use File::Temp (); use lib qw(t/lib); use dbixcsl_dumper_tests; + my $t = 'dbixcsl_dumper_tests'; $t->cleanup; diff --git a/t/60dbicdump_config.t b/t/60dbicdump_config.t index fb2d067..2d2a60b 100644 --- a/t/60dbicdump_config.t +++ b/t/60dbicdump_config.t @@ -8,7 +8,6 @@ use Test::More; use File::Path qw/make_path rmtree/; use DBIx::Class::Schema::Loader::Utils 'slurp_file'; use Try::Tiny; -use namespace::clean; use lib 't/lib'; use make_dbictest_db (); use dbixcsl_test_dir '$tdir'; diff --git a/t/65dbicdump_invocations.t b/t/65dbicdump_invocations.t index df667ed..25da225 100644 --- a/t/65dbicdump_invocations.t +++ b/t/65dbicdump_invocations.t @@ -6,7 +6,6 @@ use warnings; use Test::More; use DBIx::Class::Schema::Loader::Utils 'slurp_file'; use File::Path 'rmtree'; -use namespace::clean; use lib 't/lib'; use make_dbictest_db (); use dbixcsl_test_dir '$tdir'; diff --git a/t/lib/dbixcsl_dumper_tests.pm b/t/lib/dbixcsl_dumper_tests.pm index 912cb17..ed236b2 100644 --- a/t/lib/dbixcsl_dumper_tests.pm +++ b/t/lib/dbixcsl_dumper_tests.pm @@ -10,9 +10,8 @@ use List::Util 'any'; use DBIx::Class::Schema::Loader::Utils 'dumper_squashed'; use DBIx::Class::Schema::Loader (); use Class::Unload (); -use namespace::clean; - use dbixcsl_test_dir '$tdir'; +use namespace::clean; my $DUMP_PATH = "$tdir/dump"; diff --git a/t/lib/dbixcsl_test_dir.pm b/t/lib/dbixcsl_test_dir.pm index 6af8511..eef5f0a 100644 --- a/t/lib/dbixcsl_test_dir.pm +++ b/t/lib/dbixcsl_test_dir.pm @@ -5,8 +5,8 @@ use warnings; use File::Path 'rmtree'; use File::Temp 'tempdir'; use Scalar::Util 'weaken'; -use namespace::clean; use DBI (); +use namespace::clean; use base qw/Exporter/; our @EXPORT_OK = '$tdir';