From owner-freebsd-questions Mon Apr 13 13:51:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA15407 for freebsd-questions-outgoing; Mon, 13 Apr 1998 13:51:29 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from mole.slip.net (mole.slip.net [207.171.193.16]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA15339 for ; Mon, 13 Apr 1998 20:51:22 GMT (envelope-from leonardc9@usa.net) Received: from sf-asc1-214-215.dialup.slip.net ([209.152.135.215] helo=workhorse.leonard.com) by mole.slip.net with smtp (Exim 1.90 #1) id 0yOqBv-00060w-00; Mon, 13 Apr 1998 13:51:00 -0700 Message-Id: <3.0.5.32.19980413135149.007cb630@pop.slip.net> X-Sender: leonard@pop.slip.net X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Mon, 13 Apr 1998 13:51:49 -0700 To: Bruce Albrecht From: Leonard Subject: Re: Setting shell environment vars in perl Cc: questions@FreeBSD.ORG In-Reply-To: <199804130510.AAA14499@zuhause.mn.org> References: <3.0.5.32.19980412125035.007b7e30@pop.slip.net> <3.0.5.32.19980412125035.007b7e30@pop.slip.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 At 12:10 AM 4/13/98 -0500, you wrote: What's interesting is that I was trying to set the home directory in a sub-shell. The problem for me is that the system runs perl scripts as Nobody rather than my user account, and I needed to set HOME so that a program could run. Anyways, I set up the script on another FreeBSD system where httpd is configured differently and everything seems fine. Leonard >Setting environmental variables in perl scripts do not change the >environment variables in the shell that invoked it, but any children >of the perl script (i.e., something that uses fork, system, exec, >backticks, pipes in open statements) will have the environment >variables you set in the script. This is not a perl limitation, it's >the way environment variables work on all Unix operating systems. > >The closest you can get to having a perl script set environment >variables for your shell would be to do something like > eval `perlscript` >and have perlscript output something like > VAR=value; export VAR (bourne, bash, ksh) >or > setenv VAR value (csh, tcsh) > > > -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 5.5.3 for non-commercial use iQA/AwUBNTJ64+AvLUJUxjQXEQIyOwCfXHcLf7zNEy0bN/7yXPwgt6pX5ZMAoND/ gB9W8tLaFo2WZdg0XgbSYy8i =jdVF -----END PGP SIGNATURE----- -- Support the Blue Ribbon Campaign for free speech online () http://www.eff.org/blueribbon.html /\ "Those who will not reason perish in the act. Those who will not act, perish for that reason." - W. H. Auden To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message