|< 1 2 >| | 18 Einträge, 2 Seiten |
1 2 3 4 5 6 7 8 9 10 11 12 13
package Benutzer; @ISA = ('Person'); use NET::ldap; use strict; sub new { my $class = shift; my ($id, $nachname, $vorname) = @_; $class->SUPER::new($id, $nachname, $vorname); [...] }
Can't locate object method "new" via package "Benutzer"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#!/usr/bin/perl -w use strict; package Person; sub new { my $proto = shift; my $self = bless {}, ref $proto || $proto; print "Parameter: @_\n"; return $self; } package Benutzer; use base 'Person'; sub new { my $class = shift; my ($id, $nachname, $vorname) = @_; $class->SUPER::new($id, $nachname, $vorname); } package main; new Benutzer(1, 'hinten', 'vorne' );
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package Person; use strict; sub new { my $class = shift; my $self = bless {} , ref $class || $class; my ($id, $nachname, $vorname) = @_; $self->{'id'} = $id; $self->{'nachname'} = $nachname; $self->{'vorname'} = $vorname; #bless $self, ref $class || $class; # wegen Vererbung return $self; }
Can't locate Person.pm in @INC
tsy+2008-03-17 17:44:36--[...], bekomme ich
Code: (dl )Can't locate Person.pm in @INC
obwohl sich die Klasse im selben Verzeichnis befindet. Was habe ich denn noch übersehen?
[...]
1
2
3
4
5
6
7
8
main "root"-Verzeichnis
|
|---> Skripte.pl
|
|--->UserDomain
| |--->Person.pm
| |--->Benutzer.pm
| ... | ...
Can't locate Person.pm in @INC
use Person;
Can't locate object method "new" via package "Benutzer" (perhaps you forgot to load "Benutzer"?)
1 2 3 4 5 6 7 8 9 10 11 12 13
package UserDomain::Benutzer; use base 'UserDomain::Person'; use NET::ldap; use strict; sub new { my $class = shift; my ($id, $nachname, $vorname) = @_; $class->SUPER::new($id, $nachname, $vorname); $class->{'letzterLogin'} = ""; $class->{'berechtigung'} = 0; }
Can't locate object method "new" via package "UserDomain::Benutzer" at C:/[...]/UserDomain/Benutzer.pm line 11, <DATA> line 228.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
package UserDomain::Benutzer; #use base 'UserDomain::Person'; @ISA = qw(UserDomain::Person); use NET::ldap; use strict; sub new { my $class = shift; my ($id, $nachname, $vorname) = @_; $class->SUPER::new($id, $nachname, $vorname); $class->{'letzterLogin'} = ""; $class->{'berechtigung'} = 0; }
$class->UserDomain::Person::new($id, $nachname, $vorname);
Can't locate object method "new" via package "UserDomain::Person" (perhaps you forgot to load "UserDomain::Person"?) at C:/[...]UserDomain/Benutzer.pm line 11, <DATA> line 228.
|< 1 2 >| | 18 Einträge, 2 Seiten |