Leser: 1
|< 1 2 3 >| | 23 Einträge, 3 Seiten |
1
2
3
4
5
6
7
8
9
10
11
sub fu() {
$A{1}="Hugo";
$B{1}="Schmitt";
$C{1}="Vorsitzender";
$Count=1;
return (\%A,\%B,\%C,$Count);
};
($rA,$rB,$rC,$Anzahl)=fu;
print "$rA{1} $rB{1} $rC{1}\n";
print "$rA->{1} $rB->{1} $rC->{1}\n";
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl -w
use strict;
my ($rA,$rB,$rC,$Anzahl)=fu();
print "$rA->{1} $rB->{1} $rC->{1}\n";
sub fu {
my $A{1}="Hugo";
my $B{1}="Schmitt";
my $C{1}="Vorsitzender";
my $Count=1;
return (\%A,\%B,\%C,$Count);
}
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
use strict;
use warnings;
sub pause {
print '[Return] um fortzufahren ...'; <>;
}
sub fu() {
my %A;
my %B;
my %C;
my $Count;
$Count=0;
$A{$Count}="Hugo";
$B{$Count}="Schmitt";
$C{$Count}="Vorsitzender";
$Count++;
$A{$Count}="Dieter";
$B{$Count}="Klein";
$C{$Count}="Personalrat";
$Count++;
return (\%A,\%B,\%C,$Count);
};
my %rA;
my %rB;
my %rC;
my $Anzahl;
(%rA,%rB,%rC,$Anzahl)=fu;
# Ausgabe fehlt noch bzw. funktioniert nicht.
pause;
1
2
3
4
5
6
7
8
9
C:\>perl test2.pl
syntax error at test2.pl line 8, near "$A{"
syntax error at test2.pl line 9, near "$B{"
syntax error at test2.pl line 10, near "$C{"
Global symbol "%A" requires explicit package name at test2.pl line 12.
syntax error at test2.pl line 13, near "}"
Execution of test2.pl aborted due to compilation errors.
C:\>
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl -w
use strict;
my ($rA,$rB,$rC,$Anzahl)=fu();
print "$rA->{1} $rB->{1} $rC->{1}\n";
sub fu {
my $A{1}="Hugo";
my $B{1}="Schmitt";
my $C{1}="Vorsitzender";
my $Count=1;
return (\%A,\%B,\%C,$Count);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use strict;
use warnings;
my ($rA,$rB,$rC,$Anzahl)=fu();
print "$rA->{1} $rB->{1} $rC->{1}\n";
sub fu {
my ( %A, %B, %C );
$A{1} = "Hugo";
$B{1} = "Schmitt";
$C{1} = "Vorsitzender";
my $Count = 1;
return (\%A,\%B,\%C,$Count);
}
1 2 3 4 5 6 7 8 9 10
sub funktion{ my ( %A, %B, %C ); $A{1} = "Hugo"; $B{1} = "Schmitt"; $C{1} = "Vorsitzender"; return (%A, %B, %C); } my (%a, %b, %c) = funktion ();
|< 1 2 3 >| | 23 Einträge, 3 Seiten |