Thread Kind erkennt Elternmethode nicht (12 answers)
Opened by David at 2012-06-12 21:33

topeg
 2012-06-12 23:14
#158926 #158926
User since
2006-07-10
2611 Artikel
BenutzerIn

user image
Benutze auch "warnings".

Das hier funktioniert:
test.pl:
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
#!/usr/bin/perl

use strict;
use warnings;
use utf8;

my $Modul=PraxisModul->new();
$Modul->echo();

{package PraxisModul;
use base 'Seitenmodul';
use strict;
use warnings;

sub new {
  my $class=shift;
  my $self=$class->SUPER::new();
  return $self;
}

sub echo {
  my $self=shift;
  print "Echo ";
  $self->SUPER::echo();
}
1;}


im selben Verzeichnis:

Seitenmodul.pm:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package Seitenmodul;
use strict;
use warnings;

sub new {
    my $class=shift;
    my $self={};
    bless($self, $class);
    $self->init();
    return $self;
}

sub init {
  my $self=shift;
}

sub echo {
  print "BLA\n";
}

1;

View full thread Kind erkennt Elternmethode nicht