Loading ...
Sorry, an error occurred while loading the content.

Short CGI.pm question

Expand Messages
  • Csongor Fagyal
    Hi, In a sentence: is there a way to access an object which is mostly equivalent to a CGI object? I have a module that needs a CGI instance. Right now I do
    Message 1 of 2 , Dec 17, 2002
    • 0 Attachment
      Hi,

      In a sentence: is there a way to access an object which is mostly
      "equivalent" to a CGI object?

      I have a module that needs a CGI instance. Right now I do
      <%
      ...
      use CGI;
      my $q = CGI->new;
      my $mymodule = MYMODULE->new($q);
      ...
      %>

      which works, but I do not want to create a CGI instance if there is one
      already.

      Thank you for your suggestions,
      - Csongor


      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Josh Chamas
      ... No, there is no CGI object already, but you can create one in this way just fine. Apache::ASP reties STDIN on the backend to make this possible. If you
      Message 2 of 2 , Dec 17, 2002
      • 0 Attachment
        Csongor Fagyal wrote:
        > Hi,
        >
        > In a sentence: is there a way to access an object which is mostly
        > "equivalent" to a CGI object?
        >
        > I have a module that needs a CGI instance. Right now I do
        > <%
        > ...
        > use CGI;
        > my $q = CGI->new;
        > my $mymodule = MYMODULE->new($q);
        > ...
        > %>

        No, there is no CGI object already, but you can create one
        in this way just fine. Apache::ASP reties STDIN on the
        backend to make this possible. If you want to have a $CGI
        object available in each of your scripts, you could do this:

        # global.asa file
        use vars qw($CGI);
        use CGI;

        sub Script_OnStart {
        $CGI = CGI->new;
        }

        Regards,

        Josh
        ________________________________________________________________
        Josh Chamas, Founder phone:925-552-0128
        Chamas Enterprises Inc. http://www.chamas.com
        NodeWorks Link Checking http://www.nodeworks.com


        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      Your message has been successfully submitted and would be delivered to recipients shortly.