in reply to Re^2: CGI Module
in thread CGI Module

One potential problem I see is that, as you have it, the fetch method will return a different CGI object with each invocation. Also, it's not clear to me that a OO class is particularly useful here. (I mean, if you are going to pass an object of this class around so that you can access the CGI object through it, then you may as well pass around the CGI object in the first place.)

I'm not entirely clear on what you're trying to do, but maybe this would do what you want:

package forms; my $FORMS; sub fetch { $FORMS ||= CGI->new(); return $FORMS; } ## elsewhere use forms; my $q = forms::fetch();

the lowliest monk

Replies are listed 'Best First'.
Re^4: CGI Module
by Anonymous Monk on Jun 05, 2005 at 04:13 UTC
    That worked. But I found in my infinate wisdom I didnt realize by dumb luck that Iwas calling the module AFTER the return statement so it was being ignored... I has returned to strictly using the CGI module and its all good everything works