Hi,

We would like to be able to call a sub in our CGI::App module by doing Auth($self), but in a particular case which isn't going to last long, we need to add a param to the CGI object. I know we could do things differently, but part of the reason we want to do this for compatibility with lots of existing code that does this same thing.

But we can't just do $self->query($q) as it seems we might because of the unless statement below. So I am asking why this was placed there, and if there is a good way around this, other than creating a new CGI::Application object?

sub query {
        my $self = shift;
        my ($query) = @_;

# We're only allowed to set a new query object if one does not yet exist
!
unless (exists($self->{__QUERY_OBJ})) {
my $new_query_obj;


                # If data is provided, set it!  Otherwise, create a new one.
                if (defined($query) && $query->isa('CGI')) {
                        $new_query_obj = $query;
                } else {
                        $new_query_obj = $self->cgiapp_get_query();
                }

                $self->{__QUERY_OBJ} = $new_query_obj;
        }

return $self->{__QUERY_OBJ};

Thanks,

Eric



Lead Programmer
D.M. Contact Management
250.383.0836


--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to