Leser: 4
![]() |
|< 1 2 3 4 5 6 >| | ![]() |
51 Einträge, 6 Seiten |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
sub prepare() { my $file = $liste; my (@liste_1, @liste_2); tie my @array, 'Tie::File', $file or die $!; my $index = int(scalar(@array) / 2); @liste_1 = @array[0..$index]; @liste_2 = @array[$index+1..$#array]; print "[+] Ok - list should be prepared!\n"; my $thr1 = threads->create(\&abfrage, $nick, $proxy, $host, $login, @liste_1); $thr1 = threads->create(\&abfrage, $nick, $proxy, $host, $login, @liste_2); }
&test($wert1,$wert2,$wert3,@array1);
1 2 3 4 5 6 7 8 9 10 11 12 13 14
sub test { my ($w1,$w2,$w3,@a1)=@_; # oder: my $w1=shift(@_); my $w2=shift(@_); my $w3=shift(@_); my @a1=@_; # oder: my $w1=$_[0]; my $w2=$_[1]; my $w3=$_[2]; my @a1=@_[3..$#_]; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/usr/bin/perl use strict; use warnings; sub test { my ($wert1,$wert2,$array_ref,@array)=@_; print "Ich bin $wert1\n"; print "Das ist $wert2\n"; print 'Ich bin '.join(', ',@$array_ref)."\n"; print 'Ich bin nicht '.join(', ',@array)."\n"; } my @array_a=('schlau', 'geschickt', 'gutmuetig'); my @array_b=('gross', 'schnell', 'beinhart'); &test('Programmierer', 'eine Funktion', \@array_a, @array_b);
1
2
3
4
sub abfrage{
my ($name, $proxy, $comp, $user, @liste) = @_;
print "Your name: $name - Proxy: $proxy - Host: $comp ...\n";
}
1
2
3
4
5
sub abfrage{
my($name, $proxy, $comp, $user, $liste) = @_;
my @liste = @$liste;
print "Your name: $name - Proxy: $proxy - Host: $comp ...\n";
}
1 2
my $thr1 = threads->create(\&abfrage, \@liste_1, $nick, $proxy, $host); my $thr2 = threads->create(\&abfrage, \@liste_2, $nick, $proxy, $host);
1 2 3 4 5 6 7
sub abfrage { my ($arref) = @_; for my $element(@$arref){ print $element; } } }
![]() |
|< 1 2 3 4 5 6 >| | ![]() |
51 Einträge, 6 Seiten |