in reply to Two Versions of Perl......

If this "get_iplayer" app is the one I found here, then it starts with #!/usr/bin/env perl, which means it will be run with whatever Perl comes first in the PATH environment variable. You could show us this variable by running the command echo $PATH in your terminal, and posting it here inside <code> tags. Most likely, this second version of Perl installed in /opt/dvr/bin comes first in PATH.

There are several ways to approach fixing this, such as fiddling with PATH variable. However, that can get complicated quickly*. So here's the quick fix: since this app appears to contain only two Perl scripts, get_iplayer and get_iplayer.cgi, you could change the first line of both files from "#!/usr/bin/env perl" to "#!/usr/bin/perl" (I think that's the system Perl on OS X). Of course you'd have to make this change every time you updated the app, but depending on how often that happens, this might still be easier than changing the environment variables.

* Update: For example, I ask myself whether whichever program(s) that installed the Perl at /opt/dvr/bin would break if you simply rearranged your PATH entries. Also, it's possible to change PATH temporarily when the get_iplayer scripts get run via a small wrapper script. But whether that would be "easier" than my suggestion above depends on how much experience with shell scripting on OS X you have.

Update 2: If my fix above doesn't work, then that might mean that your script is being run in a way that disregards the shebang line, which is also a possibility. In that case some further investigation would be necessary, since it might be possible to make the change at the point where perl get_iplayer is invoked. Or, you'd have to see about fixing your PATH.

Replies are listed 'Best First'.
Re^2: Two Versions of Perl... (updated)
by Anonymous Monk on May 07, 2017 at 16:39 UTC

    Haukex - silly question but which folder do the two Perl scripts that you reference reside in once get_iplayer is installed? I see the files in my users folder however I'm not certain that these are the ones that are executed when I type get_iplayer in the terminal.

    One further question. The app that I actually want to run is the web pvr manager for get_iplayer which is initialized by typing get_iplayer_web_pvr in the terminal. This brings up the web pvr in Safari. Are there any Perl scripts associated with the get_iplayer_web_pvr command that require to be modified to use the system version of Perl?

    Thanks again for your help.

      I'm not certain that these are the ones that are executed when I type get_iplayer in the terminal.

      The command "which get_iplayer" will show you which executable gets run when you type "get_iplayer" in the terminal.

      Are there any Perl scripts associated with the get_iplayer_web_pvr command that require to be modified to use the system version of Perl?

      By googling I can only guess that get_iplayer_web_pvr is from the Debian get-iplayer package, its source is nice and short:

      #!/bin/sh . /etc/default/get_iplayer_web_pvr /usr/bin/perl /usr/share/get_iplayer/get_iplayer.cgi -p $PORT -g /usr/ +bin/get_iplayer -l $LISTEN

      Which would mean that the answer to your question is no, no changes to that script are necessary. Plus, since the get_iplayer.cgi script is being specifically invoked with the system Perl at /usr/bin/perl, you might not even have to modify get_iplayer.cgi, although it wouldn't hurt.

        OK, I'm now well beyond my knowledge of what is happening so please bare with me!

        "which get_iplayer" returns /usr/local/bin/get_iplayer

        When I look in this folder get_iplayer is shown as an "alias" that contains the following:

        "/usr/local/cellar/get_iplayer/3.01.0/bin/get_iplayer; exit;"

        There is also an alias for "get_iplayer_web_pvr" which points to the same folder as above. The "get_player" and "get_iplayer_web_pvr" files that are contained in the "/usr/local/cellar/get_iplayer/3.01.0/bin" folder are both listed as unix executables by Finder. Do these executables call the Perl scripts? If so, where the Perl scripts that I need to modify to use the system version of Perl?

        I'm afraid that I'm way out of my depth in trying to figure out what is happening. Any assistance that you can provide would be greatly appreciated!

Re^2: Two Versions of Perl... (updated)
by Anonymous Monk on May 07, 2017 at 16:11 UTC

    You are correct in stating that the Perl installed at /opt/dvr/bin comes first in PATH - see below:

    /opt/local/bin:/opt/local/sbin:/opt/dvr/bin:/opt/dvr/sbin:/opt/dvr/lib/mariadb/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands

    I will try your quick fix first since that seems to be a pretty easy one to implement. I really appreciate the help and I'll come back a little later to confirm whether the quick fix works or if I need to implement one of your other suggestions.

    Thanks!