Thread perl upload script: Speicherauslastung (5 answers)
Opened by Gast at 2007-06-29 13:54

pq
 2007-06-29 18:30
#232 #232
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
[quote=opi,29.06.2007, 16:10]perl -e 'print length while read STDIN, $_, 100'

Erst nach 100 Bytes (100 Zeichen) wird die Länge ausgegeben.[/quote]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
$ echo "123456789012" | perl -wle'
my $data;
while (read(STDIN, $data, 5)) {
print "chunk: <$data>";
}'
chunk: <12345>
chunk: <67890>
chunk: <12
>
$

read() liest ja nur bis zum eof.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread perl upload script: Speicherauslastung