in reply to how to invoke a different perl interpreter based on user ENV variable

Use #!/usr/bin/env perl -w as your invocation line, and then let people set their $PATH so that they pick up the version of perl that they want.

Alternately you could write a configuration module that you call in every script, which could right away figure out which Perl you wanted, figure out whether it is it, and if it isn't then replace itself with an exec.

Depending on your needs, the configuration module could also decide what lib invocations to import so that the same Perl interpreter can serve up different versions of modules and so on. (Useful for supporting multiple development environments on the same machine.)

  • Comment on Re: how to invoke a different perl interpreter based on user ENV variable
  • Download Code