tachyon, love the idea, though there are a few minor nits I would pick.

sub new { my ( $class, $init ) = @_; $class = ref($class) || $class; my $self = {}; bless $self, $class; $self->init($init); return $self; }

Why is the ref( $class ) in there? new, to many OO programmers is a class method but the ref( $class ) is usually there to help create a clone of the object, thus making this an instance method. Which is this? It's confusing to many programmers. I'd take that out.

# uncomment this if you want to use query string and POST at the same +time (not recommended) # $data .= $ENV{'QUERY_STRING'};

That's good, but I don't see a url_param() method. Unfortunately, sometimes Web pages get coded POST data and URL parameters. Rather than forcing the programmer to a make a permanent hack to your code or reset the request method and create a new object, there should be a convenient method for getting those params.

As for not handling uploads, I would add that in. If you do that, you've provided, in one module, all of the functionality that 99% of Web programmers use. If you did that and threw in cookie support, this might be a module I could use here at work. Barring that, it's just a novelty for me in terms of serious work. I could use if for small projects, but I don't want to have more than one CGI module being used here.

On the off chance that you do add support for multipart/form-data, you'll need to take out this:

$data =~ s/%00//g; # prevent null byte hacks $data =~ tr/\000//d;

No sense in destroying most uploads :)

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to (Ovid - minor nits) Re: CGI.pm - put up or shut up by Ovid
in thread CGI.pm - put up or shut up by tachyon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.