Re: Adding to @INC
I am guessing the bigger Perl has debug information within the program. (lurking) David Green On 8 Jan, 2009, at 0:36, Vic Norton wrote: That is exactly what has happened, Sherm. Thanks a lot. Prior to my recent installation of Leopard, I had used MacPorts to install Perl5.8.8. So I have 5.8.8 in two places, in /usr/bin and in /opt/ local/bin. And /opt/local/bin comes earlier in my PATH than /usr/bin. I'm going to have to think about this. Thanks for the aside! Another curiosity. I just checked out the Perl5.8.8 files in /usr/ bin and /opt/local/bin. The /usr/bin one came with Leopard, which I bought from Apple a week or so ago. It was created on Dec 7, 2007, and it weighs 48 KB. The MacPorts perl was created on Sep 5, 2008, and weighs 1.1 MB. Why, I wonder, should one Perl5.8.8 be 25 times as big as another? Regards, Vic On Jan 7, 2009, at 3:06 PM, Sherm Pendley wrote: On Jan 7, 2009, at 10:24 AM, Vic Norton wrote: I plan to use CPANPLUS to install new packages and modules. Right now it installs them in /opt/local/lib/perl5/site_perl/5.8.8 As an aside, I think it's kind of odd that /usr/bin/perl would do that... Are you sure there's not an /opt/local/bin/perl earlier in your PATH? If you used MacPorts to install a newer Perl, that's where it would install it. sherm-- David Green mrdgr...@mac.com Where you stand determines what you see. -- SAMUEL A. CULBERT
Re: Adding to @INC
On Thu, Jan 8, 2009 at 11:24 AM, Sherm Pendley sherm.pend...@gmail.com wrote: On Jan 7, 2009, at 10:36 PM, Vic Norton wrote: Another curiosity. I just checked out the Perl5.8.8 files in /usr/bin and /opt/local/bin. The /usr/bin one came with Leopard, which I bought from Apple a week or so ago. It was created on Dec 7, 2007, and it weighs 48 KB. The MacPorts perl was created on Sep 5, 2008, and weighs 1.1 MB. Why, I wonder, should one Perl5.8.8 be 25 times as big as another? MacPorts' perl is probably built with a static libperl. Apple's is built with a dynamic libperl. Would this mean that one version is 'faster' than the other? Sam
Re: Adding to @INC
On Jan 8, 2009, at 12:27 PM, Sam Seaver wrote: On Thu, Jan 8, 2009 at 11:24 AM, Sherm Pendley sherm.pend...@gmail.com wrote: On Jan 7, 2009, at 10:36 PM, Vic Norton wrote: Another curiosity. I just checked out the Perl5.8.8 files in /usr/ bin and /opt/local/bin. The /usr/bin one came with Leopard, which I bought from Apple a week or so ago. It was created on Dec 7, 2007, and it weighs 48 KB. The MacPorts perl was created on Sep 5, 2008, and weighs 1.1 MB. Why, I wonder, should one Perl5.8.8 be 25 times as big as another? MacPorts' perl is probably built with a static libperl. Apple's is built with a dynamic libperl. Would this mean that one version is 'faster' than the other? Apple has build-time information from building the entire OS that allows them to use prebinding on their libperl. That made a big difference on pre-Tiger releases, where non-prebound dynamic libraries carried a hefty performance penalty. Since most of us don't have the info that Apple has, Perl defaults to building a static libperl on Darwin. Apple overrides the default with -Duseshrplib for their build. In Tiger and newer, the dynamic loader is much improved and the reliance on prebinding eliminated. But Perl still defaults to building a static libperl, basically out of inertia. sherm--
Re: Adding to @INC
On 7 Jan 2009, at 15:24, Vic Norton wrote: I just installed Mac OS X 10.5, and I'm trying to get Perl back up to snuff. My current @INC contains only /System/Library/Perl/5.8.8/darwin-thread-multi-2level /System/Library/Perl/5.8.8 /Library/Perl/5.8.8/darwin-thread-multi-2level /Library/Perl/5.8.8 /Library/Perl /Network/Library/Perl/5.8.8/darwin-thread-multi-2level /Network/Library/Perl/5.8.8 /Network/Library/Perl /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.8 /Library/Perl/5.8.6 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1 I plan to use CPANPLUS to install new packages and modules. Right now it installs them in /opt/local/lib/perl5/site_perl/5.8.8 This seems like a good place, but how can I add this directory to @INC? I would prefer not having to start every script with use lib '/opt/local/lib/perl5/site_perl/5.8.8'; Try adding this to your ~/.profile export PERL5LIB=${PERL5LIB}:/opt/local/lib/perl5/site_perl/5.8.8
Re: Adding to @INC
On Wed, Jan 7, 2009 at 10:30, Adam Witney awit...@sgul.ac.uk wrote: On 7 Jan 2009, at 15:24, Vic Norton wrote: I just installed Mac OS X 10.5, and I'm trying to get Perl back up to snuff. My current @INC contains only /System/Library/Perl/5.8.8/darwin-thread-multi-2level /System/Library/Perl/5.8.8 /Library/Perl/5.8.8/darwin-thread-multi-2level /Library/Perl/5.8.8 /Library/Perl /Network/Library/Perl/5.8.8/darwin-thread-multi-2level /Network/Library/Perl/5.8.8 /Network/Library/Perl /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.8 /Library/Perl/5.8.6 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1 I plan to use CPANPLUS to install new packages and modules. Right now it installs them in /opt/local/lib/perl5/site_perl/5.8.8 This seems like a good place, but how can I add this directory to @INC? I would prefer not having to start every script with use lib '/opt/local/lib/perl5/site_perl/5.8.8'; Try adding this to your ~/.profile export PERL5LIB=${PERL5LIB}:/opt/local/lib/perl5/site_perl/5.8.8 OS X 10.5 (or at least my version of 10.5) uses ~/.bash_profile not ~/.profile for user overrides to the default profile (/etc/bashrc). If this is a multiuser machine and you want the other users to see the modules as well you can set it in the default profile instead of your own. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.
Re: Adding to @INC
On Wed, Jan 07, 2009 at 03:30:59PM +, Adam Witney wrote: On 7 Jan 2009, at 15:24, Vic Norton wrote: I plan to use CPANPLUS to install new packages and modules. Right now it installs them in /opt/local/lib/perl5/site_perl/5.8.8 This seems like a good place, but how can I add this directory to @INC? I would prefer not having to start every script with use lib '/opt/local/lib/perl5/site_perl/5.8.8'; Try adding this to your ~/.profile export PERL5LIB=${PERL5LIB}:/opt/local/lib/perl5/site_perl/5.8.8 Or PERL5LIB=/opt/blahblah:$PERL5LIB, cos you want your own installs to come first, just like you normally put your own private binaries directory at the front of your $PATH. -- David Cantrell | Cake Smuggler Extraordinaire You know you're getting old when you fancy the teenager's parent and ignore the teenager -- Paul M in uknot
Re: Adding to @INC
Try adding this to your ~/.profile export PERL5LIB=${PERL5LIB}:/opt/local/lib/perl5/site_perl/5.8.8 OS X 10.5 (or at least my version of 10.5) uses ~/.bash_profile not ~/.profile for user overrides to the default profile (/etc/bashrc). If this is a multiuser machine and you want the other users to see the modules as well you can set it in the default profile instead of your own. I think either ~/.profile or ~/.bash_profile will work. My ~/.profile was created by a previous fink installation if i remember correctly.
Re: Adding to @INC
On Wed, Jan 7, 2009 at 11:13, Adam Witney awit...@sgul.ac.uk wrote: Try adding this to your ~/.profile export PERL5LIB=${PERL5LIB}:/opt/local/lib/perl5/site_perl/5.8.8 OS X 10.5 (or at least my version of 10.5) uses ~/.bash_profile not ~/.profile for user overrides to the default profile (/etc/bashrc). If this is a multiuser machine and you want the other users to see the modules as well you can set it in the default profile instead of your own. I think either ~/.profile or ~/.bash_profile will work. My ~/.profile was created by a previous fink installation if i remember correctly. Check .bash_profile, there is probably a line like . ~/.profile in it. I don't think it was Fink that added that, Fink has always just added test -r /sw/bin/init.sh . /sw/bin/init.sh to my ~/.bash_profile. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.
Re: Adding to @INC
On 7 Jan 2009, at 16:19, Chas. Owens wrote: On Wed, Jan 7, 2009 at 11:13, Adam Witney awit...@sgul.ac.uk wrote: Try adding this to your ~/.profile export PERL5LIB=${PERL5LIB}:/opt/local/lib/perl5/site_perl/5.8.8 OS X 10.5 (or at least my version of 10.5) uses ~/.bash_profile not ~/.profile for user overrides to the default profile (/etc/bashrc). If this is a multiuser machine and you want the other users to see the modules as well you can set it in the default profile instead of your own. I think either ~/.profile or ~/.bash_profile will work. My ~/.profile was created by a previous fink installation if i remember correctly. Check .bash_profile, there is probably a line like . ~/.profile in it. I don't think it was Fink that added that, Fink has always just added test -r /sw/bin/init.sh . /sw/bin/init.sh to my ~/.bash_profile. I don't have a ~/.bash_profile :-)
Re: Adding to @INC
On Wed, Jan 7, 2009 at 11:21, Adam Witney awit...@sgul.ac.uk wrote: On 7 Jan 2009, at 16:19, Chas. Owens wrote: On Wed, Jan 7, 2009 at 11:13, Adam Witney awit...@sgul.ac.uk wrote: Try adding this to your ~/.profile export PERL5LIB=${PERL5LIB}:/opt/local/lib/perl5/site_perl/5.8.8 OS X 10.5 (or at least my version of 10.5) uses ~/.bash_profile not ~/.profile for user overrides to the default profile (/etc/bashrc). If this is a multiuser machine and you want the other users to see the modules as well you can set it in the default profile instead of your own. I think either ~/.profile or ~/.bash_profile will work. My ~/.profile was created by a previous fink installation if i remember correctly. Check .bash_profile, there is probably a line like . ~/.profile in it. I don't think it was Fink that added that, Fink has always just added test -r /sw/bin/init.sh . /sw/bin/init.sh to my ~/.bash_profile. I don't have a ~/.bash_profile :-) Interesting, I just created a new user to see what it would create and it appears as if there is no ~/.profile or ~/.bash_profile for new users. So if you have either one, then you must have created it for yourself. Very odd, I would have expected OS X to create one of the two by default (even if it was just a skeleton). -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.
Re: Adding to @INC
Thanks guys! That did the trick. I added export PERL5LIB=${PERL5LIB}:/opt/local/lib/perl5/site_perl/5.8.8 to ~/.bash_profile = ~/.bashrc, and I also added keyPERL5LIB/key string/opt/local/lib/perl5/site_perl/5.8.8/string to my ~/.MacOSX/environment.plist so Mac applications, e.g., BBEdit, will also search in the right place. On Jan 7, 2009, at 10:30 AM, Adam Witney wrote: On 7 Jan 2009, at 15:24, Vic Norton wrote: I plan to use CPANPLUS to install new packages and modules. Right now it installs them in /opt/local/lib/perl5/site_perl/5.8.8 This seems like a good place, but how can I add this directory to @INC? I would prefer not having to start every script with use lib '/opt/local/lib/perl5/site_perl/5.8.8'; Try adding this to your ~/.profile export PERL5LIB=${PERL5LIB}:/opt/local/lib/perl5/site_perl/5.8.8 On Jan 7, 2009, at 10:47 AM, Chas. Owens wrote: OS X 10.5 (or at least my version of 10.5) uses ~/.bash_profile not ~/.profile for user overrides to the default profile (/etc/bashrc). If this is a multiuser machine and you want the other users to see the modules as well you can set it in the default profile instead of your own. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.
Re: Adding to @INC
Mac OS neXt also provides for a file: $HOME/.MacOSX/environment.plist. .If it's not present you can create it and its hidden directory. Contents are environment variables that you would like defined even if you haven't opened a Terminal.app session. AppleScript's do shell script command, for instance will not run your startup scripts for your chosen shell. In environment.plist you can define PERL5LIB as /opt/local/lib/perl5/site_perl/5.8.8 without adding whatever else was in $PERL5LIB. The result is independent of your choice of shell. Apple has published a note on it somewhere. Concatenations to existing environment variables will not work. Watch out for some errant scripts in /etc/ that once overwrote $PATH when it was redefined in environment.plist. -- -- From the U S of A, the only socialist country that refuses to admit it. --
Re: Adding to @INC
Now I realize that export PERL5LIB=${PERL5LIB}:/opt/local/lib/perl5/site_perl/5.8.8 is overkill. The lines keyPERL5LIB/key string/opt/local/lib/perl5/site_perl/5.8.8/string in ~/.MacOSX/environment.plist do it all. Then $ENV{PERL5LIB} = /opt/local/lib/perl5/site_perl/5.8.8 and /opt/local/lib/perl5/site_perl/5.8.8 is near the beginning of @INC. On Jan 7, 2009, at 11:50 AM, Vic Norton wrote: Thanks guys! That did the trick. I added export PERL5LIB=${PERL5LIB}:/opt/local/lib/perl5/site_perl/5.8.8 to ~/.bash_profile = ~/.bashrc, and I also added keyPERL5LIB/key string/opt/local/lib/perl5/site_perl/5.8.8/string to my ~/.MacOSX/environment.plist so Mac applications, e.g., BBEdit, will also search in the right place.
Re: Adding to @INC
That is exactly what has happened, Sherm. Thanks a lot. Prior to my recent installation of Leopard, I had used MacPorts to install Perl5.8.8. So I have 5.8.8 in two places, in /usr/bin and in /opt/ local/bin. And /opt/local/bin comes earlier in my PATH than /usr/bin. I'm going to have to think about this. Thanks for the aside! Another curiosity. I just checked out the Perl5.8.8 files in /usr/bin and /opt/local/bin. The /usr/bin one came with Leopard, which I bought from Apple a week or so ago. It was created on Dec 7, 2007, and it weighs 48 KB. The MacPorts perl was created on Sep 5, 2008, and weighs 1.1 MB. Why, I wonder, should one Perl5.8.8 be 25 times as big as another? Regards, Vic On Jan 7, 2009, at 3:06 PM, Sherm Pendley wrote: On Jan 7, 2009, at 10:24 AM, Vic Norton wrote: I plan to use CPANPLUS to install new packages and modules. Right now it installs them in /opt/local/lib/perl5/site_perl/5.8.8 As an aside, I think it's kind of odd that /usr/bin/perl would do that... Are you sure there's not an /opt/local/bin/perl earlier in your PATH? If you used MacPorts to install a newer Perl, that's where it would install it. sherm--