Thread Dispatch Table mit Objekten: Objektmethoden statt funktionen (8 answers)
Opened by Damokles at 2005-06-28 15:42

pq
 2005-06-28 22:12
#55766 #55766
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
dann machst du was verkehrt:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
$ perl -wle'
sub child::decode {
print "decode(@_)"
}
my %foo = (0110 => "decode",a=>"Hallo ",b=>"Welt!!!");
my $inst = bless {}, "child";
my $bar = $inst->can("decode");
$inst->$bar(211,"hallo","xg",\%foo);
'
decode(child=HASH(0x813c8a4) 211 hallo xg HASH(0x813c9a0))
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread Dispatch Table mit Objekten: Objektmethoden statt funktionen