Bros, I have a problem here that's got me flummoxed. CGI seems not to be returning a parameter that the log says is being passed. Here's the code:
use CGI;
my $q = new CGI;
my $function = $q->param('f');
my $id = $q->param('id');
my $table = $q->param('table');
my $coder = $q->param('coder');
if ($function eq 'load') {
loaddoc($id,$table,$coder,$data);
}
if ($function eq 'mark') {
my $h = $q->param('h');
my $t = $q->param('t');
my $junk;
($junk,my $headsent,my $headword) = split(/[sw]/,$h);
($junk,my $tailsent,my $tailword) = split(/[sw]/,$t);
warn "h: $h t: $t hs: $headsent hw: $headword ts: $tailsent tw: $
+tailword";
.
.
.
}
I am running this on Apache and it has been intermittently returning null for the h parameter, which is why I put the warn in there. So here is what the warn statement writes into the server log:
[Sat Mar 21 13:15:36 2009] [error] [client 127.0.0.1] h: t: s43w29 h
+s: hw: ts: 43 tw: 29 at C:/xampplite/cgi-bin/unitize.pl line 31., r
+eferer: http://localhost/cgi-bin/unitize.pl?f=mark&id=659&coder=1&tab
+le=test&h=s39w9&t=s39w25
So as you can see the h=s39w9 parameter is getting passed to the script but mod CGI is not picking it up somehow. The other odd thing is that sometimes it works fine. What could explain this?!?
TIA.......Steve
UPDATE: I got the param list from CGI with $q->param and listed them in the warn, and they are all there, including h.
-
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.