|< 1 2 >| | 13 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package TestClass;
#######################################
# Klassenvariablen
# Konstruktor
sub new
{
my $object = shift();
my $reference = {};
bless($reference, $object);
# Objekt-Felder
$reference->{testFeld} = undef;
return($reference);
}
# --- Getter ---
sub get_arr_testFeld
{
my $object = shift();
return($object->{testFeld});
}
# --- Setter ---
sub set_arr_testFeld
{
my $object = shift();
my @metaTags = shift();
$object->{testFeld} = @testFeld;
}
# --- Methoden ---
sub printIt
{
my $object = shift();
print($object->get_arr_testFeld());
}
#######################################
1;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl -w
use strict;
use TestClass;
sub main
{
my $test = TestClass->new();
my @arr = ('<test val="blabla">hallo</test>', '123456', 'abcdef');
$test->set_arr_testFeld(@arr);
$test->printIt();
print($test->get_arr_testFeld());
}
&main();
00
$object->{testFeld} = @testFeld;
@{$object->{testFeld}} = @metaTags;
$reference->{testFeld} = [];
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package TestClass;
#######################################
# Klassenvariablen
# Konstruktor
sub new
{
my $object = shift();
my $reference = {};
bless($reference, $object);
# Objekt-Felder
$reference->{testFeld} = [];
return($reference);
}
# --- Getter ---
sub get_arr_testFeld
{
my $object = shift();
return($object->{testFeld});
}
# --- Setter ---
sub set_arr_testFeld
{
my $object = shift();
my @testFeld = shift();
$object->{testFeld} = @testFeld;
}
# --- Methoden ---
sub printIt
{
my $object = shift();
print($object->get_arr_testFeld());
}
#######################################
1;
$reference->{testFeld} = [];
11
Quotemy @testFeld = shift();
my @testFeld = @_;
my($object,@testFeld) = @_;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/perl
use strict;
use warnings;
package TestClass;
use Data::Dumper;
sub new {
my $class = shift;
$class = ref($class) || $class;
my $self = [];
bless($self, $class);
return $self;
}
sub get {
my $self = shift;
return @$self;
}
sub set {
my $self = shift;
@$self = @_;
}
sub explode {
my $self = shift;
Dumper [$self->get()]; # print kommt an anderer Stelle. Danke an Renee!
}
package main;
my $object = new TestClass;
$object->set(qw (Hello World outside));
print $object->explode();
exit;
|< 1 2 >| | 13 Einträge, 2 Seiten |