As I make this post, CGI is at version 3.48, and it will handle GET|POST|PUT but not DELETE.
I discovered this trying to make a REST dispatch in a .cgi script. I believe you're right -- that DELETE can be handled just like GET. On my system, I made the following change to CGI.pm, and DELETE started to work (I got query string parameters back).
--- /usr/local/share/perl/5.10.0/CGI.pm.bak 2009-11-05 15:26:07.00
+0000000 -0700
+++ /usr/local/share/perl/5.10.0/CGI.pm 2009-11-05 15:23:05.000000000
+-0700
@@ -649,7 +649,7 @@ sub init {
# If method is GET or HEAD, fetch the query from
# the environment.
- if ($is_xforms || $meth=~/^(GET|HEAD)$/) {
+ if ($is_xforms || $meth=~/^(GET|HEAD|DELETE)$/) {
if ($MOD_PERL) {
$query_string = $self->r->args;
} else {
This is a pretty minor modification, and you get decent functionality out of the DELETE verb (i.e. parameters). I'd love to see at least this much provided by CGI.pm.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|