Thread checkbox abarbeiten (CGI.pm) (12 answers)
Opened by Froschpopo at 2006-08-09 01:54

pq
 2006-09-06 12:25
#8548 #8548
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
es ist ja nicht so, dass das nicht dokumentiert ist, und es ist auch nicht so,
dass froschpopo nicht weiß, wie man perldoc aufruft. er ist wirklich schon
lange genug dabei, um es besser zu wissen.
hier der entsprechende abschnitt direkt unter der erklärung von Vars():

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Many people want to fetch the entire parameter list as a hash in
which the keys are the names of the CGI parameters, and the values are
the parameters' values. The Vars() method does this. Called in a scalar
context, it returns the parameter list as a tied hash reference. Changing a
key changes the value of the parameter in the underlying CGI parameter
list. Called in a list context, it returns the parameter list as an ordinary
hash. This allows you to read the contents of the parameter list, but not to
change it.

When using this, the thing you must watch out for are multivalued CGI
parameters. Because a hash cannot distinguish between scalar and list
context, multivalued parameters will be returned as a packed string,
separated by the "\0" (null) character. You must split this packed string in
order to get at the individual values. This is the convention introduced
long ago by Steve Brenner in his cgi-lib.pl module for Perl version 4.
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 checkbox abarbeiten (CGI.pm)