user
chromatic
<!-- birthday:yyyy/09/08 -->
<p><a href="http://www.onyxneon.com/books/modern_perl/index.html">Modern Perl: the book</a> explains how Perl 5 works and how to take advantage of Perl. The fourth edition was published by the Pragmatic Bookshelf. You can <a href="https://pragprog.com/book/swperl/modern-perl-fourth-edition">download Modern Perl 4e free</a> from the Prag site.</p>
<p>I rarely participate here.</p>
<p>I've written, edited, and contributed to other <a href="http://wgz.org/chromatic/books/">technical books</a>.</p>
<p>In my spare time, I contribute to <a href="https://trendshare.org/">Trendshare</a>'s novice <a href="https://trendshare.org/how-to-invest/">stock investment guide</a> and help family members with a <a href="https://blenderrecipereviews.com/">healthy blender recipes</a> guide.</p>
<!--
<blockquote><em>"I won't aks you to grow up, but just sometime, please, aks yourself, OK, 'Who was saved?' That's all, rill easy, 'Who was saved?'... Just in the privacy of your thotz, Zoyd. As an exercise, li'l kinda Zen meditation. 'Who was saved?'... Here I thought you knew everything, it turns out you don't know ****."</em></blockquote>
<p>— Thomas Pynchon, <em>Vineland</em></p>
<p>I once wrote Perl while riding a camel in the Sahara.</p>
<p>All code posted here, unless otherwise noted, is copyright me. You are welcome to use it for the purpose of instruction, example, or as a base for your own programs. You are permitted to incorporate a code into programs for which you or your business receive compensation (of whatever form), provided it is clear that you found Perl Monks useful. Add a link to the appropriate node.</p>
<p><hr width="60%"><p>
<!-- <p>Here are some reasons to use [CPAN://CGI.pm] instead of code from a book:
<ul>
<li>Handling POST requests is different from handling GET requests. You cannot switch between the two easily with many home-grown parsers. Even if you can, a malicious user can possibly break your program by switching methods. Game over.</li>
<li>It's non-trivial to write a decoder for the multipart/form-data encoding. (I should know, [jlp] and I wrote one, with notes from [japhy] and Lincoln Stein.) If you want to handle file uploads, you're going to spend a lot of time cursing.</li>
<li>Very few home-grown approaches handle multiple values associated with a single name. What if you have a checkbox group, or a multiple-selection list? Depending on how you handle input, you'll clobber all but the last parsed value. Oops. So that's why people only order one thing at a time.</li>
<li>Your server may be vulnerable to Denial of Service attacks, if you don't check the Content-length header. (You may want to set a limit on the amount of data accepted via POST. You'd hate for someone with a T3 to upload an entire CD worth of data in a single request, especially if you don't have that much memory available to your server.)</li>
<li>Even if you do check Content-length, does your handler check to see if it's received all of the data? What happens if it encounters truncated data? Does it recover gracefully, or does it process the request with mangled data?</li>
<li>Does your code handle the quirks (and downright bugs) of various web browsers? When Netscape or IE is braindead, will your program get correct information?</li>
<li>Even if your code allows for multiple values with a name, does it account for scalar and list context when accessing that field? Does it make extra work? Does it join all values together into a string and require you to split on a character that could (by accident or malicious intent) be present in one of the values?</li>
<li>Does your code encode and decode URI-encoded characters correctly?</li>
</ul>
If you're not sure, feel free to [Seekers of Perl Wisdom|ask]. (For the sake of your skin, I recommend that you mention in your post that you want to be educated about these vulnerabilities. If you say that you think CGI.pm is a bloated piece of trash and can't understand why anyone would use it, you'll get rather incivil results. If you genuinely seek enlightenment and mark your code snippet as unproven and possibly broken, you'll get a better result.)
<p>
Feel free to link here or to [Ovid]'s <a href="http://www.easystreet.com/~ovid/cgi_course">CGI course</a> for more detail.
<hr
[id://65781|the map is posted at nearly every street corner]-->
2023-11-28 19:03:51
59895
358258
539852
6095
chromatic industries
America/Los_Angeles
on