Bug 239315 - mod_perl do NOT handle lexical scope correctly.
Summary: mod_perl do NOT handle lexical scope correctly.
Status: CLOSED DUPLICATE of bug 239314
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: mod_perl
Version: 4.5
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Joe Orton
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2007-05-07 15:02 UTC by Klaus Ethgen
Modified: 2007-11-17 01:14 UTC (History)
0 users

Clone Of:
Last Closed: 2007-05-15 13:36:02 UTC

Attachments (Terms of Use)

Description Klaus Ethgen 2007-05-07 15:02:50 UTC
Description of problem:
mod_perl do NOT handle lexical scope correctly. (See the script below.)

Version-Release number of selected component (if applicable):

Steps to Reproduce:
1. Set up a http server
2. Configure it to execute the following script with mod_perl
3. Load (force) the following script _several times_ with a browser

--- script begin ---
#! /usr/bin/perl

sub test1
   my $test = join "", map {('a' .. 'z')[int(rand(26))]} (1 .. 6);

   sub _test2
      my $par = shift;

      if ($par eq $test)
         print <<"EOF";
Content-Type: text/plain

Variables identical: $test
         print <<"EOF";
Content-Type: text/plain

Variables NOT identical: $par != $test
      } # if ($par eq $test) { ... } els...
   } # _test2

} # test1

--- script end ---
Actual results:
Several times: "Variables identical: dfhkdf"
Then most time: "Variables NOT identical: uskeoy != crmcsm"

Expected results:
Always "Variables identical: dfhkdf"

Additional info:
As you can see in the test script there is a function defined in the logical 
scope of a other function (block).

Comment 1 Joe Orton 2007-05-15 13:36:02 UTC

*** This bug has been marked as a duplicate of 239314 ***

Note You need to log in before you can comment on or make changes to this bug.