Jan Eden wrote:
Hi all,

I wrote a little form mail script and start by setting the environment variables like this:

BEGIN {
    $ENV{PATH} = "/usr/sbin";
    delete @ENV{ qw( IFS CDPATH ENV BASH_ENV) };
}

Now the actual directory (.) is obviously not searched anymore, since

my $page_head = eval do('page_head.pl');

returns an empty $page_head while

my $page_head = eval do('./page_head.pl');

fills it with the appropriate content.

Commenting the BEGIN block above and printing $ENV{PATH} gives me:

/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices

I cannot see the current working directory in that list (but I admit that I am not used to environment variables at all).

Can someone tell me how to restrict $ENV{PATH} but keep the script's ability to see something in its own directory?


The current working directory and the script's own directory are different things.


perldoc Cwd
perldoc FindBin

Does,

use FindBin qw($Bin);

my $page_head = eval do($Bin . '/page_head.pl');

Get you where you are going?

Out of curiousity what's with the 'eval do' stuff? What are you really trying to do?

http://danconia.org

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