Re: Perl install problems OSX 10.4.11
At 13:04 +0100 15/9/09, Mine wrote: I am not quite sure which is the main Perl folder. /usr/local/bin contains two Unix executable Perl files — Perl and Perl 5.10.1. I assume that this should be the first directory. In /usr/bin/ you should have a link which will point to the default version of Perl -- Eg: ?$ cd /usr/bin/; ls -al ... lrwxr-xr-x 1 root wheel 25 Dec 19 2008 perl -> /usr/local/bin/perl5.10.0 You can delete this link and create a new one to point to the Perl binary you want to use. I seem to recall that you need to log out and log in again for the link to show up correctly in the /usr/bin/ listing. JD
Re: Perl install problems OSX 10.4.11
At 13:04 +0100 9/15/09, Mine wrote: >Hi Doug, > >Just before I create the file I would like to check a few points. > >> but you should edit that so that the first directory, before the first >> separating colon, is the one that perl 5.10 is in > >I am not quite sure which is the main Perl folder. /usr/local/bin contains >two Unix executable Perl files - Perl and >Perl 5.10.1. I assume that this should be the first directory. Ouch. There really ought NOT to be two perl executables. And they would have to have different names to be allowed in the file system. Is there a Macintosh alias or a UNIX link called "perl" which points to one of them? You might even find a link/alias in /usr/bin or /bin that some helpful porter put there. The UNIX tool: which perl can be helpful. You can also, in Terminal, do something like cd /usr/ local/lib/perl5/5.10.1 ./perl -v to see just what you have. The ./ tells the kernel to forget about $PATH and look in the current directory only. In real UNIX file systems perl and Perl would be different. Apple's HFS file system treats them the same (well you can change that) but the likes of CPAN and perl itself might not. > >Which files is PERL5LIB. All the installed modules are stored in /usr/ >local/lib/perl5/5.10.1/. Is this the location of >the PERL5LIB. If so, do I need the full path /usr/local/lib/ perl5/5.10.1/ or >can I use /usr/local/lib/. Environment variable PERL5LIB adds a directory of your choice to perl's @INC list. The way I use it is to place modules, some of my own creation and others downloaded from the likes of CPAN, into my own directory in my own space where I can control it all. Placing a directory within a perl distribution into PERL5LIB probably won't help much but it's conceivable that you could pick up a module from one distribution for use in another. Personally I have had serious problems with CPAN which are related to my need to keep modules on a disk that is not the startup disk. The procedures may be better now - it has been a few years and OS neXt versions since I have tried. > >If the above is correct, then the following is what I think I should write to >a plist file. > > >www.apple.com/DTDs/PropertyList-1.0.dtd"> > > >PATH >/usr/local/bin:/usr/local/lib:/opt/local/bin:/opt/ > local/sbin >PERL5LIB >/usr/local/lib/perl5 > > > >opt/local/bin and /opt/local/sbin is taken from a .profile created by >MacPorts which >I hope will preserve the links for MacPorts. I think this would be better. I have added the directories that have the regular UNIX tools in them at the end. Yours will be looked at first.. I have also removed a space. Watch out for line ends added by rampant email and mail list "services" there should be no line ends or spaces between and and the DOCTYPE line should be all one line. http://www.apple.com/DTDs/PropertyList-1.0.dtd";> PATH /usr/local/bin:/usr/local/lib:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/sbin:/usr/sbin > > You can also, in Terminal, change the PATH temporarily with the shell path (lower case) command or by resetting environment variable PATH which is setenv in my favorite shell (tcsh) but is different in bash. Remember that you have to log out and back in to persuade OS neXt to read the plist file. The "sbin" directories are supposed to be for use by system managers. You might not need them but there are those periodic cleanups that run automatically. Whonoze? -- --> From the U S of A, the only socialist country that refuses to admit it. <--
Re: Perl install problems OSX 10.4.11
Hi Doug, Just before I create the file I would like to check a few points. but you should edit that so that the first directory, before the first separating colon, is the one that perl 5.10 is in I am not quite sure which is the main Perl folder. /usr/local/bin contains two Unix executable Perl files — Perl and Perl 5.10.1. I assume that this should be the first directory. Which files is PERL5LIB. All the installed modules are stored in /usr/ local/lib/perl5/5.10.1/. Is this the location of the PERL5LIB. If so, do I need the full path /usr/local/lib/ perl5/5.10.1/ or can I use /usr/local/lib/. If the above is correct, then the following is what I think I should write to a plist file. www.apple.com/DTDs/PropertyList-1.0.dtd"> PATH /usr/local/bin:/usr/local/lib:/opt/local/bin:/opt/ local/sbin PERL5LIB /usr/local/lib/perl5 opt/local/bin and /opt/local/sbin is taken from a .profile created by MacPorts which I hope will preserve the links for MacPorts. Thanks, Terrence On 15 Sep 2009, at 04:18, Doug McNutt wrote: At 01:10 +0100 9/15/09, Mine wrote: Hi Doug, Thanks for the info, but I think this possibly way out side my level of experience. Would what you have suggested allow get_iplayer find the path to Perl 5.10.1 when I try to run get_iplayer from the terminal? If it does then I don't fully understand your instructions. I assume mkdir $HOME/.MacOSX creates a directory. I tried it but could not find the directory. When I used cat > $HOME/.MacOSX/ environment.plist in the Terminal, it seemed to hang. When you say "paste the text of the new file here" what text do you mean? cat, used that way is waiting for you to paste the text onto the Terminal screen. The text will become the contents of the environment.plist file. The problem is that Apple takes pleasure in making things difficult for users who might be able to muck something up. Those leading dots typically identify files that are private to the system. You can see dotted files with the unix command "ls -a" for list all. cat stands for concatenate which reads standard input, the terminal screen, and writes to standard out which the > directs to a file. You use control-D to terminate the input. I also used cat to display my environment.plist file. You can see the command that immediately precedes the text. But remember that you do have to edit the copy of my file to meet your needs. It is likely that you need only the PATH part but you should edit that so that the first directory, before the first separating colon, is the one that perl 5.10 is in. You probably don't want my personal bin directory but you might want to have a PERL5LIB directory which could also contain modules that would be found wherever perl came from. The /bin and /usr/bin items are pretty much required. cat, for instance, gets found that way. The file format is xml. Entries are in pairs of lines defines the name and declares the corresponding value. You might well have a text editor, bbedit or text wrangler (its free cousin) come to mind, that would have no problems dealing with directories whose names start with a dot. That would be fine in place of unix tool cat. You could also use Apple's plist editor but I suspect it would confuse you more than it would help. I dislike it. -- --> From the U S of A, the only socialist country that refuses to admit it. <--
Re: Perl install problems OSX 10.4.11
At 01:10 +0100 9/15/09, Mine wrote: >Hi Doug, > >Thanks for the info, but I think this possibly way out side my level of >experience. >Would what you have suggested allow get_iplayer find the path to Perl 5.10.1 >when I try to run get_iplayer from the terminal? > >If it does then I don't fully understand your instructions. >I assume mkdir $HOME/.MacOSX creates a directory. I tried it but could not >find the directory. When I used cat > $HOME/.MacOSX/environment.plist in the >Terminal, it seemed to hang. > >When you say "paste the text of the new file here" what text do you mean? cat, used that way is waiting for you to paste the text onto the Terminal screen. The text will become the contents of the environment.plist file. The problem is that Apple takes pleasure in making things difficult for users who might be able to muck something up. Those leading dots typically identify files that are private to the system. You can see dotted files with the unix command "ls -a" for list all. cat stands for concatenate which reads standard input, the terminal screen, and writes to standard out which the > directs to a file. You use control-D to terminate the input. I also used cat to display my environment.plist file. You can see the command that immediately precedes the text. But remember that you do have to edit the copy of my file to meet your needs. It is likely that you need only the PATH part but you should edit that so that the first directory, before the first separating colon, is the one that perl 5.10 is in. You probably don't want my personal bin directory but you might want to have a PERL5LIB directory which could also contain modules that would be found wherever perl came from. The /bin and /usr/bin items are pretty much required. cat, for instance, gets found that way. The file format is xml. Entries are in pairs of lines defines the name and declares the corresponding value. You might well have a text editor, bbedit or text wrangler (its free cousin) come to mind, that would have no problems dealing with directories whose names start with a dot. That would be fine in place of unix tool cat. You could also use Apple's plist editor but I suspect it would confuse you more than it would help. I dislike it. -- --> From the U S of A, the only socialist country that refuses to admit it. <--
Re: Perl install problems OSX 10.4.11
Hi Doug, Thanks for the info, but I think this possibly way out side my level of experience. Would what you have suggested allow get_iplayer find the path to Perl 5.10.1 when I try to run get_iplayer from the terminal? If it does then I don't fully understand your instructions. I assume mkdir $HOME/.MacOSX creates a directory. I tried it but could not find the directory. When I used cat > $HOME/.MacOSX/environment.plist in the Terminal, it seemed to hang. When you say "paste the text of the new file here" what text do you mean? Terrence On 15 Sep 2009, at 00:11, Doug McNutt wrote: At 23:26 +0100 9/14/09, Mine wrote: Is it possible to add the Perl 5.10.1 path to the environment so i don't loose the MacPort option. mkdir $HOME/.MacOSX and put this, after changing it a bit, in the new folder. This is just a copy of mine. cat > $HOME/.MacOSX/environment.plist paste the text of the new file here type CONTROL D should handle it without having to use finder which just doesn't like directories that start with a dot. Note that you cannot add things to &PATH this way. You have to specify the whole thing with full path names. The file is read when you log in to OS neXt in the GUI sense. It is not read when you open a Terminal or run a perl script. [~]% cat ~/.MacOSX/environment.plist "http://www.apple.com/DTDs/PropertyList-1.0.dtd";> PROGRESS Progress DOUG Douglas P. McNutt LANG us_ENG LC_ALL C PATH /Users/doug/local/bin:/Users/doug/bin:/opt/local/ bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin SERVER_NAME Earth SHELLOG /Users/doug/logs/shel_log PROJ /Volumes/Echo/Projects PERL5LIB /Users/doug/perl -- --> From the U S of A, the only socialist country that refuses to admit it. <--
Re: Perl install problems OSX 10.4.11
At 23:26 +0100 9/14/09, Mine wrote: >Is it possible to add the Perl 5.10.1 path to the environment so i >don't loose the MacPort option. mkdir $HOME/.MacOSX and put this, after changing it a bit, in the new folder. This is just a copy of mine. cat > $HOME/.MacOSX/environment.plist paste the text of the new file here type CONTROL D should handle it without having to use finder which just doesn't like directories that start with a dot. Note that you cannot add things to &PATH this way. You have to specify the whole thing with full path names. The file is read when you log in to OS neXt in the GUI sense. It is not read when you open a Terminal or run a perl script. [~]% cat ~/.MacOSX/environment.plist http://www.apple.com/DTDs/PropertyList-1.0.dtd";> PROGRESS Progress DOUG Douglas P. McNutt LANG us_ENG LC_ALL C PATH /Users/doug/local/bin:/Users/doug/bin:/opt/local/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin SERVER_NAME Earth SHELLOG /Users/doug/logs/shel_log PROJ /Volumes/Echo/Projects PERL5LIB /Users/doug/perl -- --> From the U S of A, the only socialist country that refuses to admit it. <--
Re: Perl install problems OSX 10.4.11
Hi, Thanks to all who have responded. I have tried Packy Anderson suggestion but I found that some modules stated that they only come as part of Perl 5.10.1. If I try to install them, it seem that they want to be installed in a location other than that which I have specified. I have Perl 5.10.1 installed but I don't know how set my environment so get_iplayer to use it. MacPorts has set my environment to export PATH=/opt/local/bin:/opt/ local/sbin:$PATH so the version of Perl (5.8.8) installed by MacPorts is being used by get_iplayer. Is it possible to add the Perl 5.10.1 path to the environment so i don't loose the MacPort option. I have reinstall Apple's developer tools from my system install disk. Thanks, Terrence On 14 Sep 2009, at 19:41, Alan Fry wrote: Hi Terrence, On 14 Sep 2009, at 13:04, Mine wrote: I think the problem is probably to do with my Perl install. I looked in /System/Library/Perl/ but the Perl folder contained 5.8.6 not 5.8.8. I could not find any of the following: Fcntl HTML HTTP LWP I have one machine here which is running 10.4.11 and, as you say, it has Perl 5.8.6 and also is missing the modules you list above. If it were me I would stick with the Apple install and, as Packy Anderson has suggested, go to CPAN and download the missing modules. I previously installed some applications using MacPorts, and it appears that there is an install of Perl 5.8.8 in /opt/local/bin/. Over the weekend still trying to solve the problem I also installed Perl 5.10.1 in an attempt to upgrade my system Perl install. That is in /usr/local/bin/. I also searched /usr/local/lib/perl5/5.10.1/ and /opt/local/lib/ perl5/5.8.8/ and it would appear that the MacPorts install is the most complete but I could not find an LWP directory or HTTP, and I was not sure where to look for URI. The HTML directory contained entities.pm, and headerParser.pm but no Cookies I hate multiple versions of Perl, unless there is some compelling reason for having a newer one, because of the confusion it can cause. In the case of 'get_iplayer.pl', so far as I can see, there is no reason to want any newer version of Perl than 5.8.6. Is it possible to upgrade the system Perl install to a full version of Perl 5.8.8? I don't think there is any such thing really -- one is always encountering scripts which use modules one hasn't got. Then it's off to CPAN to repair the omission. Kind regards, Alan On 14 Sep 2009, at 11:09, Alan Fry wrote: On 13 Sep 2009, at 03:46, Doug McNutt wrote: At 23:22 +0100 9/12/09, Mine wrote: Hi, Thanks for your excellent response, makes installing so easy assuming I did it correctly. I think everything that was required is installed, but I am not sure everything was installed in the right location. It appears that Perl 5.10.1 was installed and all the modules I installed are associated with Perl 5.10.1. When I try to run the get_iplayer PVR module I get the following error: Can't locate loadable object for module HTML::Parser in @INC (@INC contains: /opt/local/lib/perl5/5.8.8/darwin-2level (I have abbreviated the error message) And when I enter perl -v I get the following: This is perl, v5.8.8 built for darwin-2level So the system does not see the Perl 5.10.1 install. Can someone please tell me if there is a was to install the modules so they relate to perl, v5.8.8, or point get_iplayer to use Perl 5.10.1. I suspect that Apple's perl is 5.8.8 and it is installed in /usr/ bin. It needs to stay there because Apple's updates may depend on it. Installing 5.10.1 in /usr/bin/ replacing 5.8.8 is not recommended. I also suspect that perl 5.10 is installed in /usr/local/bin but that might be different like /opt/bin depending on just how you installed it.. Look around for it. /opt/local/lib/ sounds unlikely to me. You are probably going to make a change to your PATH environment variable to make the directory that perl 5,10 resides in appear before /usr/bin. A shell command like: setenv PATH /usr/local/bin:$PATH # csh PATH=/usr/local/bin:$PATH # something like this in bash export PATH You can also specify PATH in a startup file $HOME/.MacOSX/environment.plist. but you'll have to create that including the .MacOSX directory unless it's already there. There are some instructions on Apple's web site. Ask if you'd like a sample. @INC is a perl array that lists directories in which modules can be found. There are a bunch of standard locations relative to the directory that perl itself lives in but you can add more directories by setting the PERL5LIB environment variable to a PATH-like list of other directories. That too can be done in environment.plist. It's a bit hard to understand why iplayer doesn't have an installation script or at least some less geeky instructions for users. I am puzzled why the original poster is having problems with 'get_iplayer'. Out of c
Re: Perl install problems OSX 10.4.11
No, Ultimately unless you know for sure the module is installed by testing to see if it exists I would assume it needs to be installed. Apple's developer tools will need to be installed (or mac ports) if you want to compile and build tools, or in this case perl modules. This is just standard operating procedure if you want to develop in general on the Mac. See Packy Anderson's post on how to install with CPAN, I would advise new people who have not installed/compiled perl on Mac OS X using either the default system perl or their own version to look at the article below, it will help avoid some common pitfalls: http://developer.apple.com/mac/library/releasenotes/OpenSource/PerlExtensionsRelNotes/index.html 2cents - Brian PS: sorry didn't cc the list here it is again. On Mon, Sep 14, 2009 at 10:23 AM, Doug McNutt wrote: > Is it possible that some perl modules are not installed until Apple's > developer tools are installed? > -- > > --> A fair tax is one that you pay but I don't <-- >
Re: Perl install problems OSX 10.4.11
Is it possible that some perl modules are not installed until Apple's developer tools are installed? -- --> A fair tax is one that you pay but I don't <--
Re: Perl install problems OSX 10.4.11
OS X 10.4 shipped with 5.8.6, which is what he has. I think some of the misunderstanding is from Terrence's inexperience with perl. Terrence, the modules you're missing aren't missing because you don't have "a full version of perl". They're probably missing because they weren't included in the base distribution of perl for version 5.8.6. One of perl's great strengths as a programming language is that there is a library of modules called the Comprehensive Perl Archive Network (CPAN, for short) that allows programmers to build on the efforts of others without having to re-invent the wheel. The modules you're missing are modules to do things like build HTML documents and communicate via web protocols. Anyway, from time to time, modules are added to the base install, so there are modules that come standard with 5.8.8 and 5.10.1 that weren't standard with 15.8.6. It may also be that Apple decides to add modules to the perl it's delivering with OS X. Anyway, none of this is really a problem, since you can install the modules you need, and things should just work. Here's some commands that will help you: $ head -1 get_iplayer This will tell you which perl of yours the iplayer is using. The one I'm using says /usr/bin/perl, but you may have modified yours. $ which perl This shows you which perl you're using by default. If it shows the same perl as the one iplayer is using, you don't need to type the full path when referring to perl when you want to add modules. $ sudo /usr/bin/perl -MCPAN -e shell This will run the CPAN shell, which will allow you to install modules in the library used by /usr/bin/perl. If you're using a different perl than that one, use that path. cpan> install LWP cpan> install Fcntl cpan> install HTML cpan> install HTTP These commands tell the CPAN shell to install those modules. Again, I don't think you're going to solve your problem under OS X 10.4 Tiger without installing the modules you're missing, because I don't think your problem is that you don't have "a full version of perl". I think the problem is that Apple decided to add optional modules to 10.5 that they hadn't added to 10.4 and aren't part of the base perl install. You can easily add these modules through the CPAN shell, however, so your solution should probably be that. Or upgrade to OS X 10.5. I did that this past weekend to my G4 Powerbook. Yes, I know I'm a full rev behind, but better late than never. -packy On Sep 14, 2009, at 8:04 AM, Mine wrote: Hi, Thank you for the very informative response Alan. I think the problem is probably to do with my Perl install. I looked in /System/Library/Perl/ but the Perl folder contained 5.8.6 not 5.8.8. I could not find any of the following: Fcntl HTML HTTP LWP I previously installed some applications using MacPorts, and it appears that there is an install of Perl 5.8.8 in /opt/local/bin/. Over the weekend still trying to solve the problem I also installed Perl 5.10.1 in an attempt to upgrade my system Perl install. That is in /usr/local/bin/. I also searched /usr/local/lib/perl5/5.10.1/ and /opt/local/lib/ perl5/5.8.8/ and it would appear that the MacPorts install is the most complete but I could not find an LWP directory or HTTP, and I was not sure where to look for URI. The HTML directory contained entities.pm, and headerParser.pm but no Cookies Is it possible to upgrade the system Perl install to a full version of Perl 5.8.8? Thanks, Terrence On 14 Sep 2009, at 11:09, Alan Fry wrote: On 13 Sep 2009, at 03:46, Doug McNutt wrote: At 23:22 +0100 9/12/09, Mine wrote: Hi, Thanks for your excellent response, makes installing so easy assuming I did it correctly. I think everything that was required is installed, but I am not sure everything was installed in the right location. It appears that Perl 5.10.1 was installed and all the modules I installed are associated with Perl 5.10.1. When I try to run the get_iplayer PVR module I get the following error: Can't locate loadable object for module HTML::Parser in @INC (@INC contains: /opt/local/lib/perl5/5.8.8/darwin-2level (I have abbreviated the error message) And when I enter perl -v I get the following: This is perl, v5.8.8 built for darwin-2level So the system does not see the Perl 5.10.1 install. Can someone please tell me if there is a was to install the modules so they relate to perl, v5.8.8, or point get_iplayer to use Perl 5.10.1. I suspect that Apple's perl is 5.8.8 and it is installed in /usr/ bin. It needs to stay there because Apple's updates may depend on it. Installing 5.10.1 in /usr/bin/ replacing 5.8.8 is not recommended. I also suspect that perl 5.10 is installed in /usr/local/bin but that might be different like /opt/bin depending on just how you installed it.. Look around for it. /opt/local/lib/ sounds unlikely to me. You are pro
Re: Perl install problems OSX 10.4.11
Hi, Thank you for the very informative response Alan. I think the problem is probably to do with my Perl install. I looked in /System/Library/Perl/ but the Perl folder contained 5.8.6 not 5.8.8. I could not find any of the following: Fcntl HTML HTTP LWP I previously installed some applications using MacPorts, and it appears that there is an install of Perl 5.8.8 in /opt/local/bin/. Over the weekend still trying to solve the problem I also installed Perl 5.10.1 in an attempt to upgrade my system Perl install. That is in /usr/local/bin/. I also searched /usr/local/lib/perl5/5.10.1/ and /opt/local/lib/ perl5/5.8.8/ and it would appear that the MacPorts install is the most complete but I could not find an LWP directory or HTTP, and I was not sure where to look for URI. The HTML directory contained entities.pm, and headerParser.pm but no Cookies Is it possible to upgrade the system Perl install to a full version of Perl 5.8.8? Thanks, Terrence On 14 Sep 2009, at 11:09, Alan Fry wrote: On 13 Sep 2009, at 03:46, Doug McNutt wrote: At 23:22 +0100 9/12/09, Mine wrote: Hi, Thanks for your excellent response, makes installing so easy assuming I did it correctly. I think everything that was required is installed, but I am not sure everything was installed in the right location. It appears that Perl 5.10.1 was installed and all the modules I installed are associated with Perl 5.10.1. When I try to run the get_iplayer PVR module I get the following error: Can't locate loadable object for module HTML::Parser in @INC (@INC contains: /opt/local/lib/perl5/5.8.8/darwin-2level (I have abbreviated the error message) And when I enter perl -v I get the following: This is perl, v5.8.8 built for darwin-2level So the system does not see the Perl 5.10.1 install. Can someone please tell me if there is a was to install the modules so they relate to perl, v5.8.8, or point get_iplayer to use Perl 5.10.1. I suspect that Apple's perl is 5.8.8 and it is installed in /usr/ bin. It needs to stay there because Apple's updates may depend on it. Installing 5.10.1 in /usr/bin/ replacing 5.8.8 is not recommended. I also suspect that perl 5.10 is installed in /usr/local/bin but that might be different like /opt/bin depending on just how you installed it.. Look around for it. /opt/local/lib/ sounds unlikely to me. You are probably going to make a change to your PATH environment variable to make the directory that perl 5,10 resides in appear before /usr/bin. A shell command like: setenv PATH /usr/local/bin:$PATH # csh PATH=/usr/local/bin:$PATH # something like this in bash export PATH You can also specify PATH in a startup file $HOME/.MacOSX/environment.plist. but you'll have to create that including the .MacOSX directory unless it's already there. There are some instructions on Apple's web site. Ask if you'd like a sample. @INC is a perl array that lists directories in which modules can be found. There are a bunch of standard locations relative to the directory that perl itself lives in but you can add more directories by setting the PERL5LIB environment variable to a PATH- like list of other directories. That too can be done in environment.plist. It's a bit hard to understand why iplayer doesn't have an installation script or at least some less geeky instructions for users. I am puzzled why the original poster is having problems with 'get_iplayer'. Out of curiosity I downloaded it and find it runs fine here on a standard Apple Perl install. Regrettably I have deleted the original post but I recollect the writer said he was not a frequent user of Perl? So I wondered if the following thoughts might be helpful. 'get_iplayer.pl' is just a 272KB script (272KB) which can be put anywhere convenient and there is excellent documentation for it on the download site. Just for starters it is convenient to park it on the desktop. The first thing to do is set the executable flag by the following line in Terminal.app chmod +x -- it being understood that the easiest way to get the is just to drag 'get-iplayer.pl> from where it is on the Desktop into the Terminal window. The next thing is simply to put as the command line in Terminal (on line of course) and it should then list all available BBC TV files in alphabetical order. If it does not, then some investigation is called for. To do this it makes life very much easier if the hidden folders (containing Perl and its modules) are made visible. To this execute the following in Terminal: /Developer/Tools/SetFile -a v 'full-path-name' and then: killall "Finder" For 'full path name put successively, /bin, /Library, /sbin, / System and /usr. (The process can be reversed by running the line again with the lower-case 'v' replaced by an upper-case 'V'.) Now 'get_iplayer.pl' starts with the 'shebang' "#!/usr/bin/perl". So go
Re: Perl install problems OSX 10.4.11
On 13 Sep 2009, at 03:46, Doug McNutt wrote: At 23:22 +0100 9/12/09, Mine wrote: Hi, Thanks for your excellent response, makes installing so easy assuming I did it correctly. I think everything that was required is installed, but I am not sure everything was installed in the right location. It appears that Perl 5.10.1 was installed and all the modules I installed are associated with Perl 5.10.1. When I try to run the get_iplayer PVR module I get the following error: Can't locate loadable object for module HTML::Parser in @INC (@INC contains: /opt/local/lib/perl5/5.8.8/darwin-2level (I have abbreviated the error message) And when I enter perl -v I get the following: This is perl, v5.8.8 built for darwin-2level So the system does not see the Perl 5.10.1 install. Can someone please tell me if there is a was to install the modules so they relate to perl, v5.8.8, or point get_iplayer to use Perl 5.10.1. I suspect that Apple's perl is 5.8.8 and it is installed in /usr/ bin. It needs to stay there because Apple's updates may depend on it. Installing 5.10.1 in /usr/bin/ replacing 5.8.8 is not recommended. I also suspect that perl 5.10 is installed in /usr/local/bin but that might be different like /opt/bin depending on just how you installed it.. Look around for it. /opt/local/lib/ sounds unlikely to me. You are probably going to make a change to your PATH environment variable to make the directory that perl 5,10 resides in appear before /usr/bin. A shell command like: setenv PATH /usr/local/bin:$PATH # csh PATH=/usr/local/bin:$PATH # something like this in bash export PATH You can also specify PATH in a startup file $HOME/.MacOSX/environment.plist. but you'll have to create that including the .MacOSX directory unless it's already there. There are some instructions on Apple's web site. Ask if you'd like a sample. @INC is a perl array that lists directories in which modules can be found. There are a bunch of standard locations relative to the directory that perl itself lives in but you can add more directories by setting the PERL5LIB environment variable to a PATH-like list of other directories. That too can be done in environment.plist. It's a bit hard to understand why iplayer doesn't have an installation script or at least some less geeky instructions for users. I am puzzled why the original poster is having problems with 'get_iplayer'. Out of curiosity I downloaded it and find it runs fine here on a standard Apple Perl install. Regrettably I have deleted the original post but I recollect the writer said he was not a frequent user of Perl? So I wondered if the following thoughts might be helpful. 'get_iplayer.pl' is just a 272KB script (272KB) which can be put anywhere convenient and there is excellent documentation for it on the download site. Just for starters it is convenient to park it on the desktop. The first thing to do is set the executable flag by the following line in Terminal.app chmod +x -- it being understood that the easiest way to get the is just to drag 'get-iplayer.pl> from where it is on the Desktop into the Terminal window. The next thing is simply to put as the command line in Terminal (on line of course) and it should then list all available BBC TV files in alphabetical order. If it does not, then some investigation is called for. To do this it makes life very much easier if the hidden folders (containing Perl and its modules) are made visible. To this execute the following in Terminal: /Developer/Tools/SetFile -a v 'full-path-name' and then: killall "Finder" For 'full path name put successively, /bin, /Library, /sbin, /System and /usr. (The process can be reversed by running the line again with the lower-case 'v' replaced by an upper-case 'V'.) Now 'get_iplayer.pl' starts with the 'shebang' "#!/usr/bin/perl". So go to '/usr/bin' (now visible) and look for 'perl' -- it will surely be there. The script 'uses' the following: use Env q...@path]; use Fcntl; use File::Copy; use File::Path; use File::stat; use Getopt::Long; use HTML::Entities; use HTTP::Cookies; use HTTP::Headers; use IO::Seekable; use IO::Socket; use LWP::ConnCache; use LWP::UserAgent; use POSIX qw(mkfifo); use Time::Local; use URI; use POSIX qw(:termios_h); So, go to /System/Library/Perl/5.8.8 and look down the list to see that all these things are present. I would be astonished if any are missing in an Apple standard Perl install, but in that unlikely event, I would think the simplest thing would be to download the missing module from CPAN and pop it in. (On Mac OS X 10.4.* it might be 5.8.4 (?) I think, but that shouldn't matter at all -- the script should be quite happy with that version). The next thing to check is that /System/Library/Perl is listed in @INC. Run the following in Terminal: perl -e 'foreach (@INC) {print"$_\n"}' In
Re: Perl install problems OSX 10.4.11
On Sep 12, 2009, at 7:46 PM, Doug McNutt wrote: At 23:22 +0100 9/12/09, Mine wrote: Hi, Thanks for your excellent response, makes installing so easy assuming I did it correctly. I think everything that was required is installed, but I am not sure everything was installed in the right location. It appears that Perl 5.10.1 was installed and all the modules I installed are associated with Perl 5.10.1. When I try to run the get_iplayer PVR module I get the following error: Can't locate loadable object for module HTML::Parser in @INC (@INC contains: /opt/local/lib/perl5/5.8.8/darwin-2level (I have abbreviated the error message) And when I enter perl -v I get the following: This is perl, v5.8.8 built for darwin-2level So the system does not see the Perl 5.10.1 install. Can someone please tell me if there is a was to install the modules so they relate to perl, v5.8.8, or point get_iplayer to use Perl 5.10.1. I suspect that Apple's perl is 5.8.8 and it is installed in /usr/ bin. It needs to stay there because Apple's updates may depend on it. Installing 5.10.1 in /usr/bin/ replacing 5.8.8 is not recommended. FWIW, OS X 10.4 had perl 5.8.6 (10.5 had 5.8.8, and 10.6 has 5.8.9 and 5.10.0). The above 5.8.8 is in /opt, and has the architecture- specific subdirectory darwin-2level, so that is definitely *not* the standard Apple one from any release. Running: % which perl will tell which perl is the default. I'm guessing the perl script uses something like: #! /usr/bin/env perl and so it is finding your default perl. Changing this line to point to your 5.10.1 perl, or changing your PATH environment variable so that the first directory is where your 5.10.1 perl is, should fix this problem. -- Edward Moy Apple Inc.
Re: Perl install problems OSX 10.4.11
Well, most people don't have multiple perl installs. Also get_iplayer isn't a slick end-user product. It's a utility. Anyway, the one thing that's not mentioned here is if you can figure out the path to the 5.10.1 perl, you could change the shebang line at the start of the get_iplayer script. Right now, it reads: #!/usr/bin/perl Change that to point to your 5.10.1 perl, and it should have the proper @INC to use the modules you have installed for 5.10.1. On Sep 12, 2009, at 10:46 PM, Doug McNutt wrote: At 23:22 +0100 9/12/09, Mine wrote: Hi, Thanks for your excellent response, makes installing so easy assuming I did it correctly. I think everything that was required is installed, but I am not sure everything was installed in the right location. It appears that Perl 5.10.1 was installed and all the modules I installed are associated with Perl 5.10.1. When I try to run the get_iplayer PVR module I get the following error: Can't locate loadable object for module HTML::Parser in @INC (@INC contains: /opt/local/lib/perl5/5.8.8/darwin-2level (I have abbreviated the error message) And when I enter perl -v I get the following: This is perl, v5.8.8 built for darwin-2level So the system does not see the Perl 5.10.1 install. Can someone please tell me if there is a was to install the modules so they relate to perl, v5.8.8, or point get_iplayer to use Perl 5.10.1. I suspect that Apple's perl is 5.8.8 and it is installed in /usr/ bin. It needs to stay there because Apple's updates may depend on it. Installing 5.10.1 in /usr/bin/ replacing 5.8.8 is not recommended. I also suspect that perl 5.10 is installed in /usr/local/bin but that might be different like /opt/bin depending on just how you installed it.. Look around for it. /opt/local/lib/ sounds unlikely to me. You are probably going to make a change to your PATH environment variable to make the directory that perl 5,10 resides in appear before /usr/bin. A shell command like: setenv PATH /usr/local/bin:$PATH # csh PATH=/usr/local/bin:$PATH # something like this in bash export PATH You can also specify PATH in a startup file $HOME/.MacOSX/environment.plist. but you'll have to create that including the .MacOSX directory unless it's already there. There are some instructions on Apple's web site. Ask if you'd like a sample. @INC is a perl array that lists directories in which modules can be found. There are a bunch of standard locations relative to the directory that perl itself lives in but you can add more directories by setting the PERL5LIB environment variable to a PATH-like list of other directories. That too can be done in environment.plist. It's a bit hard to understand why iplayer doesn't have an installation script or at least some less geeky instructions for users. -- --> A fair tax is one that you pay but I don't <--
Re: Perl install problems OSX 10.4.11
At 23:22 +0100 9/12/09, Mine wrote: >Hi, > >Thanks for your excellent response, makes installing so easy assuming I did >it correctly. >I think everything that was required is installed, but I am not sure >everything was installed >in the right location. > >It appears that Perl 5.10.1 was installed and all the modules I installed are >associated with >Perl 5.10.1. When I try to run the get_iplayer PVR module I get the following >error: >Can't locate loadable object for module HTML::Parser in @INC (@INC contains: >/opt/local/lib/perl5/5.8.8/darwin-2level >(I have abbreviated the error message) > >And when I enter perl -v I get the following: >This is perl, v5.8.8 built for darwin-2level > >So the system does not see the Perl 5.10.1 install. Can someone please tell >me if there is a >was to install the modules so they relate to perl, v5.8.8, or point >get_iplayer to use Perl 5.10.1. > I suspect that Apple's perl is 5.8.8 and it is installed in /usr/bin. It needs to stay there because Apple's updates may depend on it. Installing 5.10.1 in /usr/bin/ replacing 5.8.8 is not recommended. I also suspect that perl 5.10 is installed in /usr/local/bin but that might be different like /opt/bin depending on just how you installed it.. Look around for it. /opt/local/lib/ sounds unlikely to me. You are probably going to make a change to your PATH environment variable to make the directory that perl 5,10 resides in appear before /usr/bin. A shell command like: setenv PATH /usr/local/bin:$PATH # csh PATH=/usr/local/bin:$PATH # something like this in bash export PATH You can also specify PATH in a startup file $HOME/.MacOSX/environment.plist. but you'll have to create that including the .MacOSX directory unless it's already there. There are some instructions on Apple's web site. Ask if you'd like a sample. @INC is a perl array that lists directories in which modules can be found. There are a bunch of standard locations relative to the directory that perl itself lives in but you can add more directories by setting the PERL5LIB environment variable to a PATH-like list of other directories. That too can be done in environment.plist. It's a bit hard to understand why iplayer doesn't have an installation script or at least some less geeky instructions for users. -- --> A fair tax is one that you pay but I don't <--
Re: Perl install problems OSX 10.4.11
Hi, Thanks for your excellent response, makes installing so easy assuming I did it correctly. I think everything that was required is installed, but I am not sure everything was installed in the right location. It appears that Perl 5.10.1 was installed and all the modules I installed are associated with Perl 5.10.1. When I try to run the get_iplayer PVR module I get the following error: Can't locate loadable object for module HTML::Parser in @INC (@INC contains: /opt/local/lib/perl5/5.8.8/darwin-2level (I have abbreviated the error message) And when I enter perl -v I get the following: This is perl, v5.8.8 built for darwin-2level So the system does not see the Perl 5.10.1 install. Can someone please tell me if there is a was to install the modules so they relate to perl, v5.8.8, or point get_iplayer to use Perl 5.10.1. Thanks, Terrence On 12 Sep 2009, at 05:02, Packy Anderson wrote: On Sep 11, 2009, at 5:33 PM, Mine wrote: I don't fully understand what Perl does but if Perl comes installed with OSX it appears that I also have an install of Perl via MacPorts. I assume that get_iplayer is looking at the preinstalled Perl but I am not sure. Perl is a programming language, and it appears that get_iplayer is written in it. The perl that comes installed with OS X is located at /usr/bin/ perl. If you've also installed perl from some other source (like MacPorts) then you might have another perl at some other location. I've taken a look at the iplayer source (available through http:// linuxcentre.net/getiplayer/) and it's definitely using the Perl that comes with OS X at /usr/bin/perl/ Although I am no expert, I have used the Terminal to install binaries before so i will give it a go. It's fairly simple. Type sudo perl -MCPAN -e shell At a Terminal prompt and enter in your password when prompted. You'll be asked to configure CPAN the first time you run it; just take the defaults and you'll be fine. Then, once you get a "cpan[1] >" command prompt, type the following: cpan[1]> install LWP and hit enter. It will automatically figure out what prerequisites you need and download all the packages. Again, I generally take the defaults and everything works well. -packy
Re: Perl install problems OSX 10.4.11
On Sep 11, 2009, at 5:33 PM, Mine wrote: I don't fully understand what Perl does but if Perl comes installed with OSX it appears that I also have an install of Perl via MacPorts. I assume that get_iplayer is looking at the preinstalled Perl but I am not sure. Perl is a programming language, and it appears that get_iplayer is written in it. The perl that comes installed with OS X is located at /usr/bin/perl. If you've also installed perl from some other source (like MacPorts) then you might have another perl at some other location. I've taken a look at the iplayer source (available through http:// linuxcentre.net/getiplayer/) and it's definitely using the Perl that comes with OS X at /usr/bin/perl/ Although I am no expert, I have used the Terminal to install binaries before so i will give it a go. It's fairly simple. Type sudo perl -MCPAN -e shell At a Terminal prompt and enter in your password when prompted. You'll be asked to configure CPAN the first time you run it; just take the defaults and you'll be fine. Then, once you get a "cpan[1] >" command prompt, type the following: cpan[1]> install LWP and hit enter. It will automatically figure out what prerequisites you need and download all the packages. Again, I generally take the defaults and everything works well. -packy
Re: Perl install problems OSX 10.4.11
Hi, Thanks for replying Andrew. I don't fully understand what Perl does but if Perl comes installed with OSX it appears that I also have an install of Perl via MacPorts. I assume that get_iplayer is looking at the preinstalled Perl but I am not sure. Although I am no expert, I have used the Terminal to install binaries before so i will give it a go. Terrence On 11 Sep 2009, at 20:32, Andrew Brosnan wrote: Don't remove your system Perl. Perl is designed to be extended with modules such as the ones you listed. They are normally installed as needed. Modules are available free via the CPAN at http://search.cpan.org/. Most perl programmers install them using the CPAN module or just via the command line. If you are not familiar with using the command line you may want to look at Fink http://www.finkproject.org/. Good luck! On Sep 11, 2009, at 3:05 PM, Mine wrote: Hi, Could someone please advise me as to which is the correct safe way to uninstall and do a complete fresh install of Perl for OSX 10.4.11. I've spent the last 4 days trying to get a program called get_iplayer to run on my Mac but is appears that I don't have a full install of Perl. I have been told that the following are some of the files I need: Built-ins: use Fcntl use File::Copy use File::Path use File::stat use Getopt::Long use IO::File use IO::Handle use IO::Seekable use IO::Socket use POSIX use POSIX use Socket use Time::Local Ones that aren't in core AFAIK: use CGI use CGI::Cookie use HTML::Entities use HTTP::Cookies use HTTP::Headers use IPC::Open3 use LWP::ConnCache use LWP::UserAgent use URI use URI::Escape This is the first time I have had to get involved with Perl so any help would be much appreciated. Thanks, Terrence