Ron Savage wrote:
V 3.94 has this on line 168:
if ( $arg->isa('CGI') ) {...
which means only a CGI-derived object can be used.
To use CGI::Simple you could - but shouldn't - try:
if ( $arg->isa('CGI') || $arg->isa('CGI::Simple') ) {...
Obviously it's ridiculous to list all possible class names here. The real solution is to use something like:
if ($arg -> can('cookie') ){ call cookie }
elsif ($arg -> can('param') ){ call param }
I have logged a bug report via rt.cpan.org on this matter.

'can' doesn't always work either. Specifically, 'can' doesn't work with CGI.pm, hence most modules use the $arg->isa('CGI') method of checking. The problem with 'can' and CGI.pm is due to the fact that CGI.pm loads methods on demand using a custom method autoLoader. This saves on startup time (which is very important in CGI scripts)


The 'param' method is always loaded, but the 'cookie' method is not, hence you can't use 'can' to see if you are dealing with a CGI.pm like interface if you are checking for the 'cookie' method (it may be loaded, but then again it may not!)

What probably should be done is to ask the CGI.pm maintainer to include a custom 'can' method that is able to specify what functions are available in the module.

And in the mean time get the CGI::Session and any other modules that require a CGI.pm like interface to use a combination of 'can' and 'isa' to see what is being passed in (ie $arg->isa('CGI') or ($arg->can('param') && $arg->can('cookie')).

You will find that many modules on CPAN will only work with CGI.pm for the above reason.

Cheers,

Cees

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to