Thread Unerwartetes Verhalten bei Operator überladen
(10 answers)
Opened by Muffi at 2012-08-21 17:05
Ich kanns endlich reproduzieren:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 my %t; tie %t, 'TH'; $t{test} = date('2012-01-01'); print $t{test}-=5; # standard hashverhalten package TH; use Tie::Hash; sub TIEHASH { my $self = {}; my $class = shift; bless $self, $class; } sub STORE { $_[0]->{$_[1]} = $_[2]; } sub FETCH { return $_[0]->{$_[1]}; } Argument "2012-01-01 00:00:00" isn't numeric in subtraction (-) Last edited: 2012-08-30 16:48:25 +0200 (CEST) 1 + 1 = 10
|