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

Re: scoping for asp subs

Expand Messages
  • dave_apache_asp
    I added this line to my subroutine, which also fixes it: my $Request = $main::Request; I have been using strict all along, but referring to $Request in a
    Message 1 of 8 , Oct 4, 2002
      I added this line to my subroutine, which also fixes it:

      my $Request = $main::Request;

      I have been using strict all along, but referring to $Request in a
      subroutine without fully qualifying it seems to be the problem. That
      was apparently causing the first $Request to be cached.

      thanks so much,
      -dave

      > As long as all variables in a subroutine are accessing
      > global variables ( like $main::Response ) or my()
      > scoped variables, then that subroutine should be able to
      > be written in a ASP script fine. Moving subs to a real
      > perl module/package avoids these problems by forcing
      > variables to be properly scoped during compilation.



      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • dave_apache_asp
      Actually, that line doesn t work after all... I went back to removing the subroutine which is the only thing that has seemed to work. The only variables that
      Message 2 of 8 , Oct 4, 2002
        Actually, that line doesn't work after all...

        I went back to removing the subroutine which is the only thing that
        has seemed to work. The only variables that aren't declared as 'my'
        in the subroutine are the intrinsic objects so I don't know how it
        could be a scoping issue. I guess I'm stumped. I'll just shut up
        now.

        thanks for tolerating me,
        -dave

        --- In apache-asp@y..., "dave_apache_asp" <dave_apache_asp@y...>
        wrote:
        > I added this line to my subroutine, which also fixes it:
        >
        > my $Request = $main::Request;
        >
        > I have been using strict all along, but referring to $Request in a
        > subroutine without fully qualifying it seems to be the problem.
        That
        > was apparently causing the first $Request to be cached.
        >
        > thanks so much,
        > -dave
        >
        > > As long as all variables in a subroutine are accessing
        > > global variables ( like $main::Response ) or my()
        > > scoped variables, then that subroutine should be able to
        > > be written in a ASP script fine. Moving subs to a real
        > > perl module/package avoids these problems by forcing
        > > variables to be properly scoped during compilation.
        >
        >
        >
        > --------------------------------------------------------------------
        -
        > To unsubscribe, e-mail: asp-unsubscribe@p...
        > For additional commands, e-mail: asp-help@p...


        ---------------------------------------------------------------------
        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.