This commit is contained in:
2024-10-14 00:08:40 +02:00
parent dbfba56f66
commit 1462d52e13
4572 changed files with 2658864 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
#!/usr/bin/perl
package MyClass;
sub new
{
my $class = shift;
my $self = {
_arg1 => shift,
};
# Print all the values just for clarification.
bless $self, $class;
return $self;
}
sub setarg1 {
my ( $self, $arg1 ) = @_;
$self->{_arg1} = $arg1 if defined($arg1);
return $self->{_arg1};
}
sub getarg1 {
my( $self ) = @_;
return $self->{_arg1};
}
1;
#my $obj1 = new MyClass "obj1";
#my $obj2 = MySubClass->new("obj2_1","obj2_2");
#print "a1:" . $obj1->getarg1() . "\n";
#$obj1->setarg1("arg1");
#print "a2:" . $obj1->getarg1() . "\n";
#print "b1:" . $obj2->getarg1() . "\n";
#$obj2->setarg1("arg1");
#print "b2:" . $obj2->getarg1() . "\n";
#print "b3:" . $obj2->getarg2() . "\n";
#$obj2->setarg2("arg2");
#print "b4:" . $obj2->getarg2() . "\n";