Man kann auch alles in ein anonymes Hash stopfen:
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;
}
\n\n
<!--EDIT|Ronnie|1110908950-->