Thread Namensraum als Skalar? (4 answers)
Opened by Gast at 2007-03-21 22:53

bloonix
 2007-03-22 11:07
#75232 #75232
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
Code: (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
use strict;
use warnings;

# Objekte mit new() erzeugen
my $a = new a;
my $b = new b;

# Methoden aufrufen
$a->test();
$b->test();

package a;

sub new {
  return bless {}, $_[0]
}

sub test {
  my $self = shift;
  print "test"
}

package b;

sub new {
  return bless {}, $_[0]
}

sub test {
  my $self = shift;
  print "test"
}

1;
\n\n

<!--EDIT|opi|1174554735-->
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread Namensraum als Skalar?