Laziness, impatience and hubris, they say, are things that make a good programmer, or at the very least, a good Perl. Hubris, though, should not mean arrogance. These questions you ask are both intelligent and ignorant. Which is to say that they are good questions to be asking, but they are easily answered by reading the documentation for CGI.pm.
First, 'var=1&var=2' means that you have checked off two selections from a list or from checkboxes and that 'var' has both values
. Of course, CGI.pm handles this elementary condition flawlessly.
Second, CGI.pm de-escapes all input so that even if it came in encoded in RFC-23190 ROT-13 EBCDIC, you wouldn't know it, but then, why would you care? You can re-escape at any time, at your discretion.
These two questions are merely the tip of the proverbial iceberg, and there is a whole lot of work going on under the waterline inside CGI.pm. It is probably better that you don't know exactly what it's doing, because some of the things that is has to do are quite unfortunate and unsettling, but that is how portability is achieved, especially with things like IIS.
Simply, it will take far less time to understand how CGI.pm
works than to develop a replacement that is even functionally equivalent in the most basic sense, regardless of the skill of the programmer. In fact, the better the programmer, the faster they will likely understand how CGI.pm works, and how it can be utilized effectively, which is a lot less to think about than the myriad of details and obscure workarounds involved in reimplementing it.
They say that when re-engineering something, you can do 80% of the work in 10% of the time, but that the last 20% can seem like an Archimedian struggle, where you are moving closer and closer to completion but are never able to get all the way there.
Of course, this does not prevent experimentation or pseudo-academic reimplementations for the purposes of discovery. However, using these academic versions in a production environment is irresponsible and naive.