Perl has a real problem in that there are so many badly
written CGI scripts around on the web and most people seem
to pick up bad habits from them before finding places like
perlmonks where they can get good advice. I'd be geniunely
interested in hearing any ideas you have about how we can
get to new Perl programmers and teach them good habits
before they meet Matt Wright and his friends.
Your assumptions about CGI parameters are wrong. It is
perfectly valid to have more than one value for each key.
CGI.pm handles this by returning a list of values for
multi-valued parameters. the older cgi-lib.pl handles it
by returning a string where the values are separated by
a \0 character. most hand-rolled solutions (like yours)
handle it by trashing all but one of the values.
I apologise if my original post sounded too much like
a flame. All I wanted to do was to point out that there are
much better ways to do what you're doing and I hope that
having been shown them, you will start to use them.
--
<http://www.dave.org.uk>
European Perl Conference - Sept 22/24 2000, ICA, London
<http://www.yapc.org/Europe/>
|