apache mod_perl question

Discussion in 'Apache' started by huoyangao, Jul 22, 2008.

  1. #1
    I have a issue with a web server runing apache mod_perl.
    the symptoms are data from one http request was used in a later
    http request. The value was stored in a my variable.

    My question is simply this:
    Is one http request served by one apache in-memory perl interpreter
    or not?

    if the script looks like this:

    my v = #whatever user entered;
    &foo();

    sub foo {
    &bar();
    }

    sub bar {
    #use v here.
    }

    It is possible that during one request foo and bar are actually run by two
    different instance of perl interpreter?
    If it is, then I find the problems. otherwise I have to look eles where.

    Thanks.
     
    huoyangao, Jul 22, 2008 IP
  2. huoyangao

    huoyangao Guest

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's almost certain that is the problem. One should never use a varible like that. If you need to use the varible
    in different functions, always pass it around.
     
    huoyangao, Jul 23, 2008 IP