From: Ken Youens-Clark Date: Tue, 11 Aug 2009 18:07:04 +0000 (+0000) Subject: Added return of diff as array in list context. X-Git-Tag: v0.11008~131 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c12a81ebacad0ab7a29d01e6147238a3e083005b;p=dbsrgits%2FSQL-Translator.git Added return of diff as array in list context. --- diff --git a/lib/SQL/Translator/Diff.pm b/lib/SQL/Translator/Diff.pm index dae513a..91b8c1a 100644 --- a/lib/SQL/Translator/Diff.pm +++ b/lib/SQL/Translator/Diff.pm @@ -258,8 +258,12 @@ sub produce_diff_sql { if ( $self->output_db !~ /^(?:MySQL|SQLite|PostgreSQL)$/ ) { unshift(@diffs, "-- Output database @{[$self->output_db]} is untested/unsupported!!!"); } - return join '', map { $_ ? ( $_ =~ /;$/xms ? $_ : "$_;\n\n" ) : "\n" } - ("-- Convert schema '$src_name' to '$tar_name':", @diffs); + + my @return = + map { $_ ? ( $_ =~ /;$/xms ? $_ : "$_;\n\n" ) : "\n" } + ("-- Convert schema '$src_name' to '$tar_name':", @diffs); + + return wantarray ? @return : join('', @return); } return undef;