Thread Daten in Loop parsen (21 answers)
Opened by gmafx at 2010-03-12 16:57

pq
 2010-03-12 17:05
#134601 #134601
User since
2003-08-04
12209 Artikel
Admin1
[Homepage]
user image
wenn ich dich richtig verstehe:
Code (perl): (dl )
1
2
3
4
5
6
7
8
# ungetestet
my @upload_fields = map { m/^File(\d+)/ ? $1 : () } $cgi->param;
# enthält jetzt die zahlen
for my $num (@upload_fields) {
    my $file = $cgi->param("Description$num");
    my $upload_filehandle = $cgi->upload("File$num");
    ...
}
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 Daten in Loop parsen