Re: CGI.pm v2.91 bug with $q->p()?
- From: "Mumia W. (reading news)" <paduille.4059.mumia.w@xxxxxxxxxxxxx>
- Date: Thu, 12 Oct 2006 15:29:22 GMT
On 10/12/2006 04:12 AM, evillen@xxxxxxxxx wrote:
I am getting a warning for reasons that I can't understand and I
hesitantly believe may be a bug with CGI.pm v2.91
Synopsis - in certain circumstances if I use the CGI.pm paragraph
method $q->p() my program will work correctly but I get a version of
the following warning in my webserver error.log:
filename.cgi: Use of uninitialized value in join or string at (eval 19)
line 15.
If I simply substitute $q->p() with "<br>" I get no warnings. The very
simple CGI code below demonstrates the problem, simply comment out
either of the final two "print" commands to see the behaviour.
It is possible that this behaviour relates to a problem with CGI.pm
v2.91 described here http://tinyurl.com/npta8 although I may be wrong
;-)
Thanks for any help
NJH
Test code - run directly from browser as filename.cgi
----------------
#!c:/perl/bin/perl.exe -w
use strict;
use diagnostics;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $q = new CGI;
#-------------------------------------------------
# Print the html header
print $q->header;
print <<END_HTML;
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<form method="post" enctype="multipart/form-data"
action="dev_test.cgi">
Type something here: <INPUT TYPE=text NAME=foo SIZE=50
MAXLENGTH=50><INPUT TYPE=submit VALUE="Submit"></P>
</form>
END_HTML
#-------------------------------------------------
#The "print" command below works fine using "<br>"
#print "You typed: ", $q->param("foo"), "<br>";
#The "print" command below creates the following warning using $q->p()
#"Use of uninitialized value in join or string at (eval 19) line 15."
print "You typed: ", $q->param("foo"), $q->p();
I cannot reproduce this behavior with Perl 5.8.4 and CGI.pm $VERSION 3.04 .
Here, calling p() with no parameters produces an empty paragraph tag:
use CGI;
my $q = new CGI;
print $q->p('Want to see an empty paragraph?'), "\n";
print $q->p(), "\n";
OUTPUT:
<p>Want to see an empty paragraph?</p>
<p />
--
Mumia W.
paduille.4059.mumia.w@xxxxxxxxxxxxx
This is a temporary e-mail to help me catch some s-p*á/m.
.
- Follow-Ups:
- Re: CGI.pm v2.91 bug with $q->p()?
- From: evillen@xxxxxxxxx
- Re: CGI.pm v2.91 bug with $q->p()?
- From: Mumia W. (reading news)
- Re: CGI.pm v2.91 bug with $q->p()?
- References:
- CGI.pm v2.91 bug with $q->p()?
- From: evillen@xxxxxxxxx
- CGI.pm v2.91 bug with $q->p()?
- Prev by Date: Perl trainer needed in The Netherlands
- Next by Date: Re: Perl scoping questions
- Previous by thread: Re: CGI.pm v2.91 bug with $q->p()?
- Next by thread: Re: CGI.pm v2.91 bug with $q->p()?
- Index(es):
Relevant Pages
|