8 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
package Modul1;
sub new {
return bless {}, shift;
}
sub sub1 {
# Reaktion auf Message1
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
package Objects;
use strict;
use warnings;
sub new { bless [], shift }
sub add { push @{$_[0]}, $_[1] }
sub call { $_->call for @{$_[0]} }
}
{
package Object;
use strict;
use warnings;
sub new { bless {}, shift }
sub call { print "yoyoyo\n"; }
}
my $objects = Objects->new();
$objects->add( Object->new() );
$objects->add( Object->new() );
$objects->call;
8 Einträge, 1 Seite |