Leser: 1
![]() |
![]() |
8 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
#Beispiel:
sub testfunc (\@\@) {
my @a1 = @{shift() };
my @a2 = @{shift() };
return "\@1=@a1\n", "\@2=@a2\n"
}
my @array1 = qw (1 2 3);
my @array2 = qw (A B C);
print testfunc( @array1, @array2);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my @numbers = (1..10);
my @words = qw(hello world outside);
function( {NUMBERS=>\@numbers , WORDS=>\@words} );
exit;
sub function {
die "Keine Parameter übergeben!\n" unless @_;
my %opt = %{ shift @_ };
print Dumper \%opt;
my @i_words = $opt{WORDS};
print Dumper \@i_words;
my @i_numbers = $opt{NUMBERS};
print Dumper \@i_numbers;
}
![]() |
![]() |
8 Einträge, 1 Seite |