Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 15741 invoked from network); 7 Jun 2004 10:42:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Jun 2004 10:42:48 -0000 Received: (qmail 71454 invoked by uid 500); 7 Jun 2004 10:42:36 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 71034 invoked by uid 500); 7 Jun 2004 10:42:34 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 71018 invoked by uid 99); 7 Jun 2004 10:42:34 -0000 Message-ID: <40C4468E.1060503@sofresam.com> Date: Mon, 07 Jun 2004 12:42:22 +0200 From: =?ISO-8859-1?Q?H=E8ctor_Al=F2s_i_Font?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; ca; rv:1.5) Gecko/20031007 X-Accept-Language: ca, eo, bg MIME-Version: 1.0 To: modperl@perl.apache.org Subject: mod_perl 2 / %ENV / "system" function Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I'm migrating a web application from mod_perl 1 to mod_perl 2 [new environment: Apache/2.0.49 (Unix) mod_perl/1.99_14 Perl/v5.8.4]. The problem is that in some places the %ENV variable is used to pass parameters to programmes called via "system". Now these variables are not found in the called programme. E.g. E.g. Programme 1 sets $ENV{XX) = 'YY' and executes "system programme2.pl", but programme2.pl does not found $ENV{XX}. Any workarounds? (The question is discussed in the documentation, but I cannot find any concrete solution). Thanks in advance Hector Test programmes: Programme 1 (main) #!/usr/bin/perl -w use strict; print "Content-type: text/plain\n\n"; $ENV{XX} = 'YYY'; for (sort keys %ENV) { print "\tENV{$_} => $ENV{$_}\n"; } system '/export/home2/admnot.bck/cgi/search/programme2.pl'; exit 0; Programme 2 #!/usr/bin/perl -w use strict; use FileHandle; my $fh = new FileHandle; $fh->open (">/var/tmp/p2.log") or die; for (sort keys %ENV) { $fh->print ("\2. ENV{$_} => $ENV{$_}\n"); } $fh->close; exit 0; -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html