7 Einträge, 1 Seite |
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
#!Perl -w
use Benchmark;
$repetitions = 1000000;
@testArray = (22, 34, 433, 123, 435, 66);
sub typeglobs {
local *kopie = shift;
foreach (@kopie) {
$_ *= 2;
}
}
sub references {
my $rarray = shift;
foreach (@$rarray) {
$_ *= 2;
}
}
print "Ueber Referenzen:\n";
timethis($repetitions, "references(\@testArray)");
print "\n\nUeber Typeglobs:\n";
timethis($repetitions, "typeglobs(*testArray)");
1
2
3
4
5
6
sub references {
my $rarray = shift;
...
}
print "Ueber Referenzen:\n";
timethis($repetitions, "references(\@testArray)");
7 Einträge, 1 Seite |