Priority: Normal
Current State: Closed
Released In: 1.1.0
Target Release: n/a
Applies To: Engine
Component:
Branches:
Some later versions of CGI appear sensitive to the string CGI and don't display it if it's the only content in CGI::th.
Babar and CDot on #foswiki came up with the solution:
$ perl -MCGI -wle'print CGI::th("CGI")'
<th />
$ perl -MCGI -wle'print CGI->th("CGI")'
<th>CGI</th>
further consultation with CDot, th expects the first variable to either be a hash, or a string. Calling as ->th passes in $class as the first parameter. Passing in an explicit hash as the first parameter is a better solution.
$ perl -MCGI -wle'print CGI::th({},"CGI")'
<th>CGI</th>
Also need to look for other calls and correct if necessary.
--
GeorgeClark - 12 Apr 2010
This is a design issue. Since
CGI.pm
is designed to work as a procedural or OO module, all its functions/methods need to verify if the first parameter is an object (blessed reference), the
CGI
string (to handle static methods calls, like
CGI->p("foo bar")
) or anything else.
So, if the first parameter to some
CGI.pm
function not called as a method can be the string
CGI, then the call should be rewritten as a static method call.
Because things like this, I'm considering to replace
CGI.pm
by
CPAN:HTML::Tiny, for example. But it will be another proposal.
--
GilmarSantosJr - 12 Apr 2010
Yeah, CGI is a piece of crap and should really be avoided. Not to mention it's huge for nothing.
Even though I strongly disagree with CDot's statement that CGI::th({},"CGI") is
better than CGI->th("CGI") (I think OO, so calling a class method, is better than calling a function from another module), I don't care about the fix
But I agree with Gilmar, it would be nice if we could look into using something else. The only advantage of
CGI.pm
is that some twisted mind thought it was a good idea to bundle it with perl, so it's now dual-life, but at least available in all the recent perl.
--
OlivierRaginel - 10 May 2010
This appears fixed by Crawford's changes. Changing status to closed.
--
GeorgeClark - 10 May 2010