From: Brandon Black Date: Tue, 11 Jul 2006 04:14:45 +0000 (+0000) Subject: Changes fixup, debug output fixup, eval optimization X-Git-Tag: 0.03004~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cb54990b0b3e5b87aca62ff0a0f03ed274e4f6f7;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Changes fixup, debug output fixup, eval optimization --- diff --git a/Changes b/Changes index b4a332c..eaae688 100644 --- a/Changes +++ b/Changes @@ -4,7 +4,6 @@ Revision history for Perl extension DBIx::Class::Schema::Loader - make_schema_at efficiency improvements - improved debugging output - column metadata now included in dumped schemas - - new fatal error if loader_options not yet specified at clone() time - Carp::Clan added, and some dies converted to croaks - no longer overwrites files when dumping, unless asked to do so via the dump_overwrite option diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 076536b..d4a7918 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -399,14 +399,16 @@ sub _dump_to_dir { sub _use { my $self = shift; my $target = shift; + my $evalstr; foreach (@_) { - $_->require or croak ($_ . "->require: $@"); + warn "$target: use $_;" if $self->debug; $self->_raw_stmt($target, "use $_;"); - warn "$target: use $_" if $self->debug; - eval "package $target; use $_;"; - croak "use $_: $@" if $@; + $_->require or croak ($_ . "->require: $@"); + $evalstr .= "package $target; use $_;"; } + eval $evalstr if $evalstr; + croak $@ if $@; } sub _inject { @@ -415,8 +417,8 @@ sub _inject { my $schema_class = $self->schema_class; my $blist = join(q{ }, @_); + warn "$target: use base qw/ $blist /;" if $self->debug && @_; $self->_raw_stmt($target, "use base qw/ $blist /;") if @_; - warn "$target: use base qw/ $blist /" if $self->debug && @_; foreach (@_) { $_->require or croak ($_ . "->require: $@"); $schema_class->inject_base($target, $_);