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   
(Show other bugs)
Version: 4.5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Joe Orton
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-05-07 15:02 UTC by Klaus Ethgen
Modified: 2007-11-17 01:14 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-15 13:36:02 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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):
1.99_16-4

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
EOF
      }
      else
      {
         print <<"EOF";
Content-Type: text/plain

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

   _test2($test);
} # test1

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.