Thread Variable Anzahl an Array-Zeilen an Subroutine übergeben
(11 answers)
Opened by norvel at 2012-08-03 16:42
Ah, kapiert.
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 sub naechstes_paket { my $handle = shift; my @lines = (); while (@lines < 10) { my $line = <$handle>; last unless $line; push @lines, $line } return @lines; } while (my @next_lines = naechstes_paket($fil) { ... mach was } 1 + 1 = 10
|