http://qs321.pair.com?node_id=95045


in reply to use _specific_ version

I'm assuming the two installs are in distinct directories. If so, why not just:
#!/path/to/right/perl BEGIN { @INC=/the/path/to/your/mods }

wouldn't that do the trick?

thanks arturo =)

We speak the way we breathe. --Fugazi

Replies are listed 'Best First'.
Re: (jptxs)Re: use _specific_ version
by particle (Vicar) on Jul 09, 2001 at 21:03 UTC
    HAHA! caught in your own web of assumptions! ;)

    my client has propriatary technology on Windows which allows applications to run in their own environment space, and without a hard-coded location. for example, alice could have perl 5.004 and 5.6.0 installed on the same machine, and run both versions at the same time without @INC getting confused. also, bob could run 5.6.0 from j:\, while charlie could run from c:\ or from k:\apps, and the scripts would all execute correctly.

    so, the path to perl is not the same for all users. it can be found with environment variables, but 1) that won't work on the #! line, and 2) windows doesn't really care anyway.

    on unix, yours is generally the method i use. but these scripts are Win32 based, and i believe others have provided me with the portable code i need, and will include everywhere.

    ~Particle

      I don't see anybody who has coded what you want. Several have given you code to check which version was called, but none to pull the version of Perl that you wanted.

      If this is just for testing, then I would recommend a wrapper script that explicitly calls the wanted version of Perl. Call the wrapper script and it should just work.

      (Don't forget that the wrapper may need to set environment variables, etc for your client's environment.)