Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the B-C CPAN distribution.

Report information
The Basics
Id:
70888
Status:
resolved
Worked:
2 hours (120 minutes)
Users:
RURBAN: 2 hours (120 minutes)
Priority:
Low/Low
Queue:

People
Owner:
RURBAN [...] cpan.org
Requestors:
glen_stewart [...] associate.com
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



Subject: env variables unreadable in compiled perl CGI
Date: Mon, 12 Sep 2011 05:42:41 -0400
To: bug-B-C@rt.cpan.org
From: Glen Stewart <glen_stewart@associate.com>
I have a simple CGI program written in perl, which is executed frequently (per second).  To avoid the CPU load from perl compiling, I chose to use B-C (via perlcc:  perlcc -o comment.cgi comment.pl).

The program is:

Show quoted text
use DBI;
use CGI qw/:standard/;

my $cgi = new CGI;

$html=$cgi->request_method();
warn("CGI request is $html");
warn("ENV request is $ENV{'REQUEST_METHOD'}");

When I look at the Apache error log, where WARN output comes when the CGI is executed, the strings are empty.  If I run the program without compiling, they are populated.

It seems environment variable handling in B-C compiled perl scripts is completely broken?

Please let me know if there is a way around this.
  • Distribution name and version: Kubuntu Maverick
  • Perl version: This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
  • Operating System vendor and version: Linux hub 2.6.35-30-generic #56-Ubuntu SMP Mon Jul 11 20:01:08 UTC 2011 x86_64 GNU/Linux


Thank you.
-- 
Associate.com - THE Place to Associate!                  http://freegroups.net
Is Your E-mail Group Here?  See http://freegroups.net/faq/your-group-here.html
Which B::C release? With 1.34 or latest svn (1.35, r1123) ENV handling and E magic seems to work fine, but I could not test your example yet. Thanks for the report -- Reini Urban
Subject: Re: [rt.cpan.org #70888] env variables unreadable in compiled perl CGI
Date: Mon, 12 Sep 2011 18:02:11 -0400
To: bug-B-C@rt.cpan.org
From: Glen Stewart <glen_stewart@associate.com>
Sorry to miss that - 1.34 The way I am using the script, in this case, is in SHTML (server side include): <!--#exec cgi="/cgi/comment.cgi" --> </BODY> </HTML> If I run the source script itself, it does output the variables: <!--#exec cgi="/cgi/comment.pl" --> </BODY> </HTML> On 09/12/2011 07:28 AM, Reini Urban via RT wrote:
Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=70888> > > Which B::C release? > With 1.34 or latest svn (1.35, r1123) ENV handling and E magic seems to work fine, but I could > not test your example yet. > > Thanks for the report
-- Associate.com - THE Place to Associate! http://freegroups.net Is Your E-mail Group Here? See http://freegroups.net/faq/your-group-here.html
See http://code.google.com/p/perl-compiler/issues/detail?id=75 %ENV keys were not initialized at run-time, just the compile-time values were used. This broke e.g. CGI scripts. Fixed in latest svn with r1135. (The upcoming B-C-1.35) On Mon Sep 12 18:02:18 2011, glen_stewart@associate.com wrote:
Show quoted text
> Sorry to miss that - 1.34 > > The way I am using the script, in this case, is in SHTML (server side > include): > > <!--#exec cgi="/cgi/comment.cgi" --> > </BODY> > </HTML> > > > If I run the source script itself, it does output the variables: > > <!--#exec cgi="/cgi/comment.pl" --> > </BODY> > </HTML> > > > > On 09/12/2011 07:28 AM, Reini Urban via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=70888> > > > > Which B::C release? > > With 1.34 or latest svn (1.35, r1123) ENV handling and E magic seems
> to work fine, but I could
> > not test your example yet. > > > > Thanks for the report
>
-- Reini Urban
Fixed with B-C-1.35 -- Reini Urban


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.