sub foo { my $self = shift; $self->query->param('id'); if (!$id) {return $self->get_id();} #get_id returns a web page that prompts the user for an id #this is all running in mod_perl, with CGI::Application my $obj = $self->get_obj($id); #else do foo kinda stuff with $obj }