If you are running your script as a given user the script should
'inherit' the environment of the user that is is being run as.  IF You
run as a daemon it should 'inherit' the environment of the user that
started the script.  If your script issues a chroot command all bets are
off since.

To set the environment as I found, I think it was in the Perl Cook Book
as I am working on a few scripts both for pleasure and work I found
this:   $ENV{PATH} = '/bin:/sbin:/usr/bin:/usr/sbin';

IMHO:  It is always a good idea to set your scripts with a path that you
want them to have rather than trusting an 'inheritance' factor.
Also if your script is to be run by many, and possibly have a net
connection it would be a good idea to further restrict with chroot.

--
Leif Ericksen
On Wed, 2006-01-11 at 04:21 +0630, Mayank Ahuja wrote:
> 
> Hi 
> 
> Could you please let me know how to change the working directory
> withoutgoing under through settingthe path variable process.
> 
> I am using the following code.
> 
> use warnings;
> 
> use strict;
> 
> use Cwd;
> 
> chdir ('/user/bin') or die can not change the directory.
> 
> if there is only one way then let me know how do we set the variable
> $ENV{HOME}.
> 
> With warm regards
> 
> Mayank
> 
-- 
Leif Ericksen <[EMAIL PROTECTED]>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to