A pure Perl version of Apache::Request? If Apache::Request is well-written, why bother with the Pure Perl version? Aside from making it easier for poor schleps to modify it, that is? :)

I was looking in apache_request.c and noticed this, though:

static int urlword_dlm[] = {'&', ';', 0}; static char *my_urlword(pool *p, const char **line) { char *res = NULL; const char *pos = *line; char ch; while ( (ch = *pos) != '\0' && ch != ';' && ch != '&') { ++pos; } res = ap_pstrndup(p, *line, pos - *line); while (ch == ';' || ch == '&') { ++pos; ch = *pos; } *line = pos; return res; }

The urlword_dlm array doesn't appear to be used anywhere else. From what I can tell, this was originally used to hold the delimiters and line endings, but when the code was last updated, the array declaration was left in, but the array itself appears to have been removed:

static int urlword_dlm[] = {'&', ';', NULL}; static char *my_urlword(pool *p, const char **line) { int i; for (i = 0; urlword_dlm[i]; i++) { int stop = urlword_dlm[i]; char *pos = strchr(*line, stop); char *res; if (!pos) { if (!urlword_dlm[i+1]) { // etc ...

That could simply be my poor C skills, but it looks like there might be some room for cruft to be removed (of course, this was the only instance I found, so I'm probably wrong), so I wonder if there is room for improvement here. In any event, since Apache::Request can be used from both C and Perl, I don't think that creating a Perl alternative gets us a strong benefit. I'm open to counter arguments, though.

And I'd just like to note that my little digression there was soooo far removed from your question that my li'l node is barely a response :)

Cheers,
Ovid

New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)


In reply to Re: Re: Re: Re: br tag in CGI.pm V2.91 by Ovid
in thread br tag in CGI.pm V2.91 by cLive ;-)

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.