On Tue, 14 Mar 2000, Simon Budig <[EMAIL PROTECTED]> wrote:
> Marc Lehmann ([EMAIL PROTECTED]) wrote:
> > This might work for python, but it will not work for perl. It will find
> > the first perl in your path (which is often perl4), not the perl gimp
> > was configured with.
> Are there really multiple different executables named "perl" (not "perl4" or
> so!) in your path? So when you work in your shell you always execute
> version 4 of perl, when you invoke "perl"?
I suppose that Marc meant that the person running a Perl-Fu script
might not the the person who has configured and installed it. It is
likely that the one who configures the Gimp has set his path correctly
(in order to be able to run configure without errors) but it can
happen that another user has a broken path, with old tools listed
first. In that case, the user would get a different version of perl
than the one that Gimp was configured with.
I think that the only way to guard against users having a broken path
is to hardcode the location of the perl executable in the scripts.
Actually, this should also be done for python because using "env" will
create exactly the same problems.
Just to give you an example, there are several versions of Perl in my
path on one of the systems I use at work:
$ /usr/bin/perl -v
This is perl, version 5.003 with EMBED
built under solaris at Nov 10 1996 13:23:19
+ suidperl security patch
$ /opt/local/bin/perl --version
This is perl, version 5.004_04 built for sun4-solaris
$ /Local/bin/perl --version
This is perl, version 5.005_03 built for sun4-solaris
There are also some older versions of Perl available, but fortunately
they have been renamed (e.g. perl4, oldperl) so that they are not used
When I configure the Gimp, I always have /Local/bin first in my path.
But this is not the case for all users: some of them have /usr/bin or
/opt/local/bin first, so they will have problems if they try to
execute the Perl-Fu scripts with perl 5.003 or 5.004.
This problem can be solved by hardcoding the path to the perl
executable in all scripts during the configure step.