Thread Frage zu subref (6 answers)
Opened by Froschpopo at 2006-06-30 07:03

Froschpopo
 2006-06-30 07:03
#67721 #67721
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
Was ist eigentlich schneller?

Bsp: 1
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
   my $count = 0;

my $fetch_img = sub {
my $item = shift;
#arbeite...
$count++;
};

for my $item (@images) {
$fetch_img->($item);
}

print "Zahl: $count";

bsp: 2
Code: (dl )
1
2
3
4
5
6
7
   my $count = 0;
for my $item (@images) {
#arbeite...
$count++;
}

print "Zahl: $count";
\n\n

<!--EDIT|Froschpopo|1151637356-->

View full thread Frage zu subref