Karakash: Getter/Setter

Beitrag lesen

Sprich:

  
package Hashtable;  
sub new() {  
my %hashtable;  
my $self=shift;  
my $newInst={};  
bless($newInst,$self);  
}  
  
package main;  
  
my $Hashtable = Hashtable ->new();  
  
$Hashtable::hashtable = {teststring=>"teststring",teststring2=>"teststring2"}  
my $Hashtable2 = Hashtable ->new();  
  
$Hashtable2::hashtable = {teststring=>"teststring3",teststring2=>"teststring4"}  
  
foreach my $key (keys my %hash=$Hashtable::hashtable)  
{  
  
print $key;  
}  
foreach my $key (keys my %hash=$Hashtable2::hashtable)  
{  
  
print $key;  
}  
  
müsste teststringteststring2 und teststring3teststring4 ausspucken?