use CGI::Fast; while (my $q = new CGI::Fast){ my $app = new MyCGIApplication(QUERY => $q); # this is your CGI::App module $app->run(); }