Re: How to build exe using pp to ignore PERL5LIB environment variable

2008-05-28 Thread Roderich Schupp
On Tue, May 27, 2008 at 11:09 PM, Henry Wu [EMAIL PROTECTED] wrote:
  I packaged an executable abc.exe from perl script using pp.  Worked
 fine for most of users, But some users have existing old perl
 installation and have environmental variable PERL5LIB set. When these
 users run the abc.exe, they saw the following messages.
 ...
 So is there a way to package exe file to ignore the PERL5LIB
 environmental variable using pp ?

AFAICT, no. But I think this is a useful suggestion:
as pp-packed executable should be considered self-contained,
they should not be subject to external settings like PERL5LIB
(Principle of Least Surprise).
But there are probably use cases for obeying PERL5LIB, too.

So I suggest:
- pp-packed executables should ignore PERL5LIB
- but they treat PAR_PERL5LIB (or some such) the same way as
  regular Perl scripts treat PERL5LIB

Looks like this could be implemented by a few lines in function
par_init_env() in  myldr/utils.c.

What do others think?

Cheers, Roderich


RE: How to build exe using pp to ignore PERL5LIB environment variable

2008-05-28 Thread Eugene Olbinsky
Not such a scrap. I did the same but instead of  set PERL5LIB=/some/where, I 
used
setenv PERL5LIB /some/where. In this case /some/where shows up all right.
Regards,
  Eugene

-Original Message-
From: Roderich Schupp [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2008 2:39 PM
To: Henry Wu
Cc: par@perl.org
Subject: Re: How to build exe using pp to ignore PERL5LIB environment variable

On Wed, May 28, 2008 at 1:02 PM, Roderich Schupp
[EMAIL PROTECTED] wrote:
 AFAICT, no. But I think this is a useful suggestion:

Scrap that. I just tried a very simple example
(version 0.980 on Solaris 9):

$ pp -o foo.exe -e print qq[INC [EMAIL PROTECTED];

and PERL5LIB is _not_ propagated to foo.exe:
when I run

$ set PERL5LIB=/some/where
$ ./foo.exe

INC = CODE(0x6df76c) CODE(0x6df958)

i.e. /some/where _doesn't_ show up in @INC

Can you try this example? And what version of
PAR and PAR::Packer are you using?

Cheers, Roderich