Thread Unerwartetes Verhalten bei Operator überladen (10 answers)
Opened by Muffi at 2012-08-21 17:05

Gast wer
 2012-08-30 17:09
#161496 #161496
funktioniert bei mir:

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
26
27
28
29
30
31
32
33
34
35
36
#!env perl
use strict;
use warnings;
use Class::Date qw(date);

print "Class::Date: ".$Class::Date::VERSION."\n";
print "Tie::Hash: ".$Tie::Hash::VERSION."\n";
print "OS: $^O\n";
print "PERL: ".(`env perl -v`)[1]."\n";

my %t;
tie %t, 'TH';

$t{test} = date('2012-01-01');
print $t{test}." --> ";
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]};
}


Code: (dl )
1
2
3
4
5
6
Class::Date: 1.1.10
Tie::Hash: 1.04
OS: linux
PERL: This is perl 5, version 14, subversion 2 (v5.14.2) built for i486-linux-gnu-thread-multi-64int

2012-01-01 00:00:00 --> 2011-12-31 23:59:55

Last edited: 2012-08-30 17:10:49 +0200 (CEST)

View full thread Unerwartetes Verhalten bei Operator überladen