Thread OO Moose (5 answers)
Opened by Moses at 2009-04-09 10:11

Gast Moses
 2009-04-09 10:11
#120427 #120427
Hallo!

Eine Frage betreffend OO/Moose:
Erstelle ich Subroutinen, die ich nur innerhalb der Klasse brauche, so

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package My_Package;
use Moose;


my $obj = My_Package->new();

sub routine {
    my $self = shift;
    ...
}


sub abcd {
        ...
        $obj->routine();
        ...
}

sub efgh {
        ...
        $obj->routine();
        ...
}
oder so
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package My_Package;
use Moose;


sub routine {
    ...
}


sub abcd {
        ...
        routine();
        ...
}

sub efgh {
        ...
        routine();
        ...
}
?

View full thread OO Moose