From: Peter Rabbitson Date: Thu, 9 Jun 2011 09:32:43 +0000 (+0200) Subject: More robust insert() logic to avoid undef warnings X-Git-Tag: v0.08193~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cf6692ad58b794f68e2803b601fb26f8436345bb;p=dbsrgits%2FDBIx-Class.git More robust insert() logic to avoid undef warnings --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index ea6ea09..4eaa431 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -357,9 +357,11 @@ sub insert { # this ensures we fire store_column only once # (some asshats like overriding it) if ( - (! defined $current_rowdata{$_}) + (!exists $current_rowdata{$_}) or - ( $current_rowdata{$_} ne $returned_cols->{$_}) + (defined $current_rowdata{$_} xor defined $returned_cols->{$_}) + or + (defined $current_rowdata{$_} and $current_rowdata{$_} ne $returned_cols->{$_}) ); }