Karakash: Verständnisproblem: Instanziierung

Beitrag lesen

Und - dein Skript läuft nicht:
Global symbol "$method" requires explicit package name at test.pl line 27.

Du hast nirgendwo $method oder $initialize definiert.

Struppi.

#!perl -w  
  
use strict;  
use warnings;  
  
package initialize;  
sub new() {  
my $IsFulfilled = 0;  
my $self=shift;  
my $newInst={};  
bless($newInst,$self);  
  
}  
  
  
package Method;  
use base 'initialize';  
sub new(){  
my $name;  
}  
	sub checkFulfilled()  
	{  
		$initialize::IsFulfilled = 1;  
	}  
  
package main;  
  
  
  
  
my $method = Method -> new();  
  
$method::IsFulfilled = 0;  
print $method::IsFulfilled;  
$method=Method->checkFulfilled();  
print $method::IsFulfilled;  
# print $method->checkFulfilled();

Console.jpg

Läuft bei mir wunderbar?
Evtl hatte es nen kleineren Tippfehler.
Ich werde mir mal den Link zur Gemüte führe.