From: Andrew Chilton Date: Mon, 23 Jun 2008 11:32:31 +0000 (+1200) Subject: Instead of using eval when setting a value, do it normally. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=acf3b982379e99eacb93cdcecb3f218933e8cc68;p=cil.git Instead of using eval when setting a value, do it normally. This was added since DateTime b0rks when it compares itself to other things. So, instead of passing around a DateTime object, we just stringify it straight away because that's all we want anyway. --- diff --git a/lib/CIL/Base.pm b/lib/CIL/Base.pm index ed5c3a8..feb7dfc 100644 --- a/lib/CIL/Base.pm +++ b/lib/CIL/Base.pm @@ -125,7 +125,7 @@ sub set { # finish if both are defined and they're the same if ( defined $orig and defined $value ) { - return if eval { $orig eq $value }; + return if $orig eq $value; } # finish if neither are defined @@ -147,7 +147,7 @@ sub set_no_update { sub set_inserted_now { my ($self) = @_; - my $time = DateTime->now; + my $time = '' . DateTime->now; $self->{data}{Inserted} = $time; $self->{data}{Updated} = $time; $self->{Changed} = 1; @@ -155,7 +155,7 @@ sub set_inserted_now { sub set_updated_now { my ($self) = @_; - my $time = DateTime->now; + my $time = '' . DateTime->now; $self->{data}{Updated} = $time; $self->{Changed} = 1; }