Bug 239315 - mod_perl do NOT handle lexical scope correctly.
mod_perl do NOT handle lexical scope correctly.
Status: CLOSED DUPLICATE of bug 239314
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: mod_perl (Show other bugs)
4.5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-07 11:02 EDT by Klaus Ethgen
Modified: 2007-11-16 20:14 EST (History)
0 users

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


Attachments (Terms of Use)

  None (edit)
Description Klaus Ethgen 2007-05-07 11:02:50 EDT
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 09:36:02 EDT

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