develooper Front page | perl.perl5.porters | Postings from April 2001

Re: Relocatable perl

Thread Previous | Thread Next
Graham Barr
April 30, 2001 09:25
Re: Relocatable perl
Message ID:
On Mon, Apr 30, 2001 at 05:14:33PM +0100, Alan Burlison wrote:
> Graham Barr wrote:
> > Is that the real path to the executable, or the path which it was invoked
> > by ?
> The real path, specifically the dirname(3C) of the associated objects
> realpath(3C).  The only restriction is that if you invoke the executable via
> a link it needs to be a symlink rather than a hard link.

OK, thats good.

> > > I suspect that to make this work I'd have to make all of those #defines into
> > > dynamic strings, and tweak them at startup.  Does this seem correct?  Where
> > 
> > Seems right to me.
> > 
> > > would I put them?  Globals?
> > 
> > They get put into @INC
> No, I don't mean that, I mean the C #defines would have to become global
> char*  because they are used in more than one place inside the interpreter.

Sorry, my misunderstanding.

> > >  This would only work if the above variables all
> > > had a common directory prefix - if someone decided for some reason to tell
> > > Configure they wanted SITELIB_EXP on a completely different filesystem there
> > > would be no common directory prefix to twiddle.
> > 
> > Just define a special token that gets replaced.
> This happens at run-time - how would that work?

Define a character constant say ROOT that would be replaces at runtime. So any
of the path variable that start ROOT would have ROOT replaced with the real

But as it has been pointed out, VMS already does this. So they have probably
already sorted out these issues.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About