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--
Adding to @INC
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'; Thanks for your help. Vic Norton
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--
@INC troubles and fun
@INC OK, I have dug up some information I found some time ago... The standard (Tiger) implementation of @INC can be modified or added to via: /Library/Perl/5.8.6/AppendToPath I am assuming the equivalent in any installed version exists, but this will sort out 5.8.6. I think that might help some headaches.
Fwd: @INC troubles and fun
Actually it is possible the below is for use by Apache... (or both) @INC OK, I have dug up some information I found some time ago... The standard (Tiger) implementation of @INC can be modified or added to via: /Library/Perl/5.8.6/AppendToPath I am assuming the equivalent in any installed version exists, but this will sort out 5.8.6. I think that might help some headaches.
Re: @INC troubles and fun
FWIW, the AppendToPath file is a general purpose mechanism to append paths to @INC. As shipped from Apple, it includes the Extras directory (which is where the third-party perl modules that we ship are installed), and (to provide backwards compatibility) it contains paths to previous /Library/Perl/5.8.x directories that we have used in the past. (Note that if you move aside the AppendToPath file, perl will run without any third-party modules, useful for testing if you depend on modules outside the standard perl distribution.) You can also add paths to a PrependToPath file (which Apple doesn't ship), to prepend paths to @INC. --- Edward Moy Apple On Sep 12, 2008, at 1:57 PM, David Green wrote: Actually it is possible the below is for use by Apache... (or both) @INC OK, I have dug up some information I found some time ago... The standard (Tiger) implementation of @INC can be modified or added to via: /Library/Perl/5.8.6/AppendToPath I am assuming the equivalent in any installed version exists, but this will sort out 5.8.6. I think that might help some headaches.
Re: problem with @INC
On Jan 17, 2008 2:33 PM, ANJAN PURKAYASTHA [EMAIL PROTECTED] wrote: Hi, a use PGPLOT command in the PDL turns up this error: snip However PGPLOT.pm seems to be present in 1. /Users/anjan/.cpan/build/PDL-2.4.3/Graphics/PGPLOT/PGPLOT.pm and 2. /Library/Perl/5.8.6/darwin-thread-multi-2level/PDL/Graphics/PGPLOT.pm any idea how to set @INC so that the PGPLOT modules are correctly located. snip Both of those files are PDL::Graphics::PGPLOT not PGPLOT. You need to install PGPLOT with cpan install PGPLOT.
problem with @INC
Hi, a use PGPLOT command in the PDL turns up this error: Can't locate PGPLOT.pm in @INC (@INC contains: /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1 .) at (eval 44) line 4, STDIN line 1. BEGIN failed--compilation aborted at (eval 44) line 4, STDIN line 1. However PGPLOT.pm seems to be present in 1. /Users/anjan/.cpan/build/PDL-2.4.3/Graphics/PGPLOT/PGPLOT.pm and 2. /Library/Perl/5.8.6/darwin-thread-multi-2level/PDL/Graphics/PGPLOT.pm any idea how to set @INC so that the PGPLOT modules are correctly located. i use mac osX 10.4.11 thanks in advance. anjan -- ANJAN PURKAYASTHA, PhD. Senior Computational Biologist == 1101 King Street, Suite 310, Alexandria, VA 22314. 703.518.8040 (office) 703.740.6939 (mobile) email: [EMAIL PROTECTED]; [EMAIL PROTECTED] http://www.vbi.vt.edu ==
@INC problem
Apple suggested I install something the other day. (Java or something like that.) I did it. Now I discover that many of my Perl scripts don't work. The problem is with @INC. It appears to have been upgraded to Perl 5.8.8. For example, when I try use Date::Parse qw(str2time); I get the message /Volumes/VTN Docs/ My Perl/Tests/test5.pl:6: Can't locate Date/Parse.pm in @INC followed by a list of what @INC contains: /Volumes/VTN Docs/ My Perl/Tests /usr/local/lib/perl5/5.8.8/darwin-2level /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/ The package Date/Parse.pm is right where it has always been, along with a whole pile of other stuff, in /Library/Perl/5.8.6 So this is my question. How do I add /Library/Perl/5.8.6 to @INC, without having to add use lib /Library/Perl/5.8.6; to every script ? Regards, Vic
Re: @INC problem
On Feb 22, 2007, at 6:21 PM, Vic Norton wrote: Apple suggested I install something the other day. (Java or something like that.) I did it. Now I discover that many of my Perl scripts don't work. The problem is with @INC. It appears to have been upgraded to Perl 5.8.8. For example, when I try use Date::Parse qw(str2time); I get the message /Volumes/VTN Docs/ My Perl/Tests/test5.pl:6: Can't locate Date/ Parse.pm in @INC followed by a list of what @INC contains: /Volumes/VTN Docs/ My Perl/Tests /usr/local/lib/perl5/5.8.8/darwin-2level /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/ That's not Apple's Perl, or anything that resulted from the recent Apple update. I've looked through the recent Apple update receipts, and didn't find anything Perl-related. You can use lsbom to check the contents of anything installed from .pkg or .mpkg packages, which includes Apple updates. The receipts are in /Library/Receipts, so to find the.boms for packages installed in the last 7 days: find /Library/Receipts -newerct '7 days ago' -name '*.bom' Then, to browse the list of files installed by a package using the less command: lsbom /Library/Receipts/JavaForMacOSX10.4Release5.pkg/Contents/ Archive.bom | less The package Date/Parse.pm is right where it has always been, along with a whole pile of other stuff, in /Library/Perl/5.8.6 So this is my question. How do I add /Library/Perl/5.8.6 to @INC, without having to add use lib /Library/Perl/5.8.6; to every script ? Possibly, someone replaced all your scripts #!/usr/bin/perl with #!/ usr/local/bin/perl. Maybe you did that to test them against the newer Perl and forgot to change it back, or maybe someone in your house has a strange sense of humor. :-) If your scripts still say #!/usr/bin/perl, then something has removed the original /usr/bin/perl and replaced it with a link to /usr/local/ bin/perl. You can check that with /usr/bin/perl -v. Fortunately, the original is also a link, to /usr/bin/perl5.8.6, so if it was disturbed, it's easy to make things right: sudo rm /usr/bin/perl sudo ln /usr/bin/perl5.8.6 /usr/bin/perl sherm-- Web Hosting by West Virginians, for West Virginians: http://wv-www.net Cocoa programming in Perl: http://camelbones.sourceforge.net
Re: @INC problem
At 18:21 -0500 2/22/07, Vic Norton wrote: So this is my question. How do I add /Library/Perl/5.8.6 to @INC, without having to add use lib /Library/Perl/5.8.6; to every script ? It's likely that there is abetter way, but. . . If you define the environment variable PERL5LIB in your $HOME/.MacOSX/environment.plist file you can add directories to @INC which will be present no matter what shell or scripting language you are using. There is an Apple-provided app note about environment.plist. What I worry about is the older functions in 5.8.6 may not work. -- -- From the U S of A, the only socialist country that refuses to admit it. --
Re: @INC problem
On 2/22/07, at 7:27 PM -0500, Sherm Pendley wrote: Possibly, someone replaced all your scripts #!/usr/bin/perl with #!/ usr/local/bin/perl. Maybe you did that to test them against the newer Perl and forgot to change it back, or maybe someone in your house has a strange sense of humor. :-) I don't have that strange a sense of humor, Sherm, and I'm the only one in the house who works with Perl. The bang lines on my problematic test routines all read #!/usr/local/bin/perl and the bang lines on good routines read #!/usr/bin/perl. I think my computer may be infected with gremlins. I've changed everything to read #!/usr/bin/perl and now everything works. Thanks so much for your help! Unfortunately most of this system stuff is a mystery to me. Regards, Vic
Re: Strange problem with @INC
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Jesse Engel) wrote: for some reason, X11 has a different version of @INC than reported with apple's terminal. if i run perl -e 'foreach (@INC) { print $_\n;}' with apple_terminal, i get for me, under 'terminal' i get : /usr/local/lib/perl5/5.8.8/darwin-2level /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl . under 'x11' : - /System/Library/Perl/5.8.1/darwin-thread-multi-2level /System/Library/Perl/5.8.1 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1 /Library/Perl /Network/Library/Perl/5.8.1/darwin-thread-multi-2level /Network/Library/Perl/5.8.1 /Network/Library/Perl . -- klp
Re: Strange problem with @INC
all suggestions are gladly welcomed. i haven't had any time to poke at it but hopefully i can find something good. i'm imagining that the lack of an xinitrc file other than the default is the culprit. i have installed perlmodules via fink and that probably has created some issues as well. thanks for all of the hints. jesse Want to start your own business? Learn how on Yahoo! Small Business. http://smallbusiness.yahoo.com/r-index
Re: Strange problem with @INC
On 平成 19/01/10, at 9:25, Jesse Engel wrote: hmm, no, just the default /usr/bin/perl. i've thought about installing 5.8.8, but haven't yet. i changed my shell to bash (doesn't everyone?) in both xterm and apple_terminal and i did make a .bashrc in which i changed the default value of $PATH to this: PATH=$PATH:/sw/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/bin:/ sw/share/doc/man Some reason for having a man directory in your executable path? Would you perhaps prefer to set a manpath (man man)? Or maybe I'm just busybodying, in which case just ignore me.
Re: Strange problem with @INC
On 1/9/07, Jesse Engel [EMAIL PROTECTED] wrote: hmm, no, just the default /usr/bin/perl. i've thought about installing 5.8.8, but haven't yet. i changed my shell to bash (doesn't everyone?) in both xterm and apple_terminal and i did make a .bashrc in which i changed the default value of $PATH to this: PATH=$PATH:/sw/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/bin:/sw/share/doc/man i am getting different outputs for echo $PATH; xterm returns more search paths. also, printenv doesn't return a PERL5LIB under xterm. i guess a good way to modify $PERL5LIB would be cool, although i have read from several sources that it is better to use lib /foo/bar; than to modify $PERL5LIB. You've installed fink at some point, and you've either used it to install something Perl-related (maybe a utility that is written in Perl? Psync? SpamAssassin?) and as part of that process, you or the installer have updated your rc file to add directories under /sw to $PERL5LIB (or to source a config file that does that). This probably happened when you ran /sw/bin/pathsetup.sh as recommended by the Fink install quide. This has nothing to do with Terminal.app; the only thing that touches /sw is Fink. /sw doesn't even exist on the system until Fink creates it, and any reference to /sw that exists in any path or environment variable was set by either you or Fink. See if your .profile or .bash_profile or .login or other rc file (I'm sure there are a few I've forgotten) doesn't have a line similar to test -r sw/bin/init.sh . sw/bin/init.sh It won't be in .bashrc, though, unless you added it yourself. As I said before, you have two options here. Since reinstalling all your Finked software manually probably isn't appealing, what you need to do is use your .xinitrc file to setup the fink environment in X. Either setup your PATH and PERL5LIB manually in .xinitrc (it works just like any other rc file) or source /sw/bin/init.sh. Google xinitrc for the gory details; the Fink X FAQ with detailed directions is actually the first hit. HTH, -- jay -- This email and attachment(s): [ ] blogable; [ x ] ask first; [ ] private and confidential daggerquill [at] gmail [dot] com http://www.tuaw.com http://www.downloadsquad.com http://www.engatiki.org values of β will give rise to dom!
Re: Strange problem with @INC
At 08:53 -0500 1/10/07, Jay Savage wrote: As I said before, you have two options here. Since reinstalling all your Finked software manually probably isn't appealing, what you need to do is use your .xinitrc file to setup the fink environment in X. Either setup your PATH and PERL5LIB manually in .xinitrc (it works just like any other rc file) or source /sw/bin/init.sh. Another option on a Mac is to define $PERL5LIB at the time of login to the OS itself. That is done with an XML file $HOME/.MacOSX/environment.plist where you can set environment variables that are set up for all applications you activate. Apple has a note on it that CAN be found on apple,com. A well behaved rc file will NOT remove things previously defined but /etc/cshrc, the global startup file, can and will overwrite any $PATH you set in environment.plist. -- -- The greenhouse effect due to water vapor has never been fully modeled and weather forecasting remains irreducibly complex. It is clear that global warming is the act of an Intelligent Designer. --
Strange problem with @INC
for some reason, X11 has a different version of @INC than reported with apple's terminal. if i run perl -e 'foreach (@INC) { print $_\n;}' with apple_terminal, i get /sw/lib/perl5/5.8.1/darwin-thread-multi-2level /sw/lib/perl5/5.8.1 /sw/lib/perl5/darwin-thread-multi-2level /sw/lib/perl5 /sw/lib/perl5/darwin /System/Library/Perl/5.8.1/darwin-thread-multi-2level /System/Library/Perl/5.8.1 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1 /Library/Perl /Network/Library/Perl/5.8.1/darwin-thread-multi-2level /Network/Library/Perl/5.8.1 /Network/Library/Perl . however, under xterm with the same command i get only the lines listed below /sw/lib/perl5/darwin (in the above example). i understand that i can have 'use lib /foo/bar' but it would be nice to have consistency. Also, printenv returns less values in X11 than in apple_terminal. any ideas why? tia, jesse __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Strange problem with @INC
hmm, no, just the default /usr/bin/perl. i've thought about installing 5.8.8, but haven't yet. i changed my shell to bash (doesn't everyone?) in both xterm and apple_terminal and i did make a .bashrc in which i changed the default value of $PATH to this: PATH=$PATH:/sw/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/bin:/sw/share/doc/man i am getting different outputs for echo $PATH; xterm returns more search paths. also, printenv doesn't return a PERL5LIB under xterm. i guess a good way to modify $PERL5LIB would be cool, although i have read from several sources that it is better to use lib /foo/bar; than to modify $PERL5LIB. i'm poking through man x to see if i can find something. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
@INC issues...
i guess i spoke too late. the xinitrc file seems to be the key. thanks much. jesse __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Strange problem with @INC
On Jan 9, 2007, at 6:25 PM, Jesse Engel wrote: i'm poking through man x to see if i can find something. That's a red herring. As Jay indicated, the only difference between your two environments is that under Terminal.app you've got $PERL5LIB set (to /sw/lib/perl5), but under X11 you don't. -Ken
@INC
How can I permanently add to @INC? I have 2 versions of perl installed and only use one of them. The reason for 2 versions is a port system that refuses to rely on the already installed perl. So I have: $ /usr/bin/perl -e 'print join(\n, @INC)' /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1 AND $ /opt/local/bin/perl -e 'print join(\n, @INC)' /opt/local/lib/perl5/5.8.7/darwin-2level /opt/local/lib/perl5/5.8.7 /opt/local/lib/perl5/site_perl/5.8.7/darwin-2level /opt/local/lib/perl5/site_perl/5.8.7 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/5.8.7/darwin-2level /opt/local/lib/perl5/vendor_perl/5.8.7 /opt/local/lib/perl5/vendor_perl I really only want to use /usr/bin/perl, but the port system will put modules into the /opt/local/bin/perl version which I want to use from /usr/bin/perl. Thanks!
Re: @INC
At 12:15 -0600 1/5/06, The Ghost wrote: How can I permanently add to @INC? I have 2 versions of perl installed and only use one of them. The reason for 2 versions is a port system that refuses to rely on the already installed perl. Try setting the PERL5LIB environment variable. It's formatted like a $PATH for perl. I set it in $HOME/.MacOSX/environment.plist so that it works when initiated from a Cocoa or Carbon application. You may have a problem with incompatibility of stuff in an @INC area that demands another version of perl. That's why the ports don't attempt to mix things up. -- -- Science is the business of discovering and codifying the rules and methods employed by the Intelligent Designer. Religions provide myths to mollify the anxiety experienced by those who choose not to participate. --
Re: @INC
At 12:15 pm -0600 5/1/06, The Ghost wrote: ...I have 2 versions of perl installed and only use one of them. The reason for 2 versions is a port system that refuses to rely on the already installed perl. So I have: /System/Library/Perl/5.8.6/darwin-thread-multi-2level AND /opt/local/lib/perl5/5.8.7/darwin-2level /opt/local/lib/perl5/5.8.7 ... If you download 5.8.7 and let it install itself in the default location without bothering even to look at the difficult questions, I guess you will solve all you problems and end up with this: @INC: /usr/local/lib/perl5/5.8.7/darwin-2level /usr/local/lib/perl5/5.8.7 /usr/local/lib/perl5/site_perl/5.8.7/darwin-2level /usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl/5.8.6/darwin-2level /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl Whatever you have in /opt or whatever other non-standard directory can then porbably be safely consigned to the trash. JD
Re: @INC
The other perl was installed by darwinports. It doesn't ask questions. If it did, I wouldn't install it. I'm not concerned about incompatibilities as the perl versions are so close. I could reconfigure darwinports, but I don't want to. So this isn't a solution to my issue. Thanks though. Ryan On Jan 5, 2006, at 2:01 PM, John Delacour wrote: At 12:15 pm -0600 5/1/06, The Ghost wrote: ...I have 2 versions of perl installed and only use one of them. The reason for 2 versions is a port system that refuses to rely on the already installed perl. So I have: /System/Library/Perl/5.8.6/darwin-thread-multi-2level AND /opt/local/lib/perl5/5.8.7/darwin-2level /opt/local/lib/perl5/5.8.7 ... If you download 5.8.7 and let it install itself in the default location without bothering even to look at the difficult questions, I guess you will solve all you problems and end up with this: @INC: /usr/local/lib/perl5/5.8.7/darwin-2level /usr/local/lib/perl5/5.8.7 /usr/local/lib/perl5/site_perl/5.8.7/darwin-2level /usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl/5.8.6/darwin-2level /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl Whatever you have in /opt or whatever other non-standard directory can then porbably be safely consigned to the trash. JD
Re: @INC
On 2006.1.6, at 05:41 AM, The Ghost wrote: The other perl was installed by darwinports. It doesn't ask questions. If it did, I wouldn't install it. I'm not concerned about incompatibilities as the perl versions are so close. I could reconfigure darwinports, but I don't want to. So this isn't a solution to my issue. I suggest you configure your Darwinports anyway. Thanks though. Ryan On Jan 5, 2006, at 2:01 PM, John Delacour wrote: At 12:15 pm -0600 5/1/06, The Ghost wrote: ...I have 2 versions of perl installed and only use one of them. The reason for 2 versions is a port system that refuses to rely on the already installed perl. So I have: /System/Library/Perl/5.8.6/darwin-thread-multi-2level AND /opt/local/lib/perl5/5.8.7/darwin-2level /opt/local/lib/perl5/5.8.7 ... If you download 5.8.7 and let it install itself in the default location without bothering even to look at the difficult questions, I guess you will solve all you problems and end up with this: @INC: /usr/local/lib/perl5/5.8.7/darwin-2level /usr/local/lib/perl5/5.8.7 /usr/local/lib/perl5/site_perl/5.8.7/darwin-2level /usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl/5.8.6/darwin-2level /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl Whatever you have in /opt or whatever other non-standard directory can then porbably be safely consigned to the trash. JD
@INC gone weird after repair
My iBook just came back from repair. The first thing I wanted to do was back up stuff that hadn't previously been. So I call psync into action and get the following: [solidgoldpig:~] alexr% sudo psync -r /Pictures/ /Volumes/192.168.0.40/SGPBACKUPS/Pictures/ Password: Can't locate MacOSX/File.pm in @INC (@INC contains: /usr/local/cb/perl5.8.4/lib/5.8.4/darwin-thread-multi-2level /usr/local/cb/perl5.8.4/lib/5.8.4 /usr/local/cb/perl5.8.4/lib/site_perl/5.8.4/darwin-thread-multi-2level /usr/local/cb/perl5.8.4/lib/site_perl/5.8.4 /usr/local/cb/perl5.8.4/lib/site_perl .) at /usr/local/bin/psync line 14. BEGIN failed--compilation aborted at /usr/local/bin/psync line 14. Which is somewhat surprising seeing that before the repair everything was fine using the stock 5.8.1 that came with my Panther installation. What is this /cb/perl5.8.4? Is it from the CamelBones bundle that I may have installed just before I had the hardware failure? Or is it something else entirely? That aside, how can I get my @INC back to the default so that all my installed modules will work again? Or rather so they'll work again after I've reinstalled them again since Apple has obviously reinstalled the OS and wiped /Library/Perl.
Re: @INC gone weird after repair
On Aug 25, 2004, at 5:44 PM, Alex Robinson wrote: What is this /cb/perl5.8.4? Is it from the CamelBones bundle that I may have installed just before I had the hardware failure? Or is it something else entirely? The Fat Camel bundle includes Perl 5.8.4, installed in /usr/local/cb/perl5.8.4/. That aside, how can I get my @INC back to the default so that all my installed modules will work again? Pick one: Delete /usr/bin/perl, which is currently a symlink to /usr/local/cb/perl5.8.4/bin/perl, and replace it with a symlink to /usr/bin/perl5.8.1. This will only affect scripts that use #! - CamelBones apps will continue to use the libperl that's installed under /usr/local/cb/. Add 'use lib qw(/Library/Perl/5.8.1 /Library/Perl/5.8.1/darwin-thread-multi-2level)' to your scripts. Install the missing MacOSX::File module under Perl 5.8.4. IMNSHO, the third listed option is best. Now that you've installed a newer Perl, there's little reason not to use it to run your scripts. And, forcing a Perl to use modules that were installed under an older Perl version is chancy - we're talking about minor revisions of 5.8.x, so it's very likely to work, but why take chances? sherm--
Re: CPAN installing to somewhere not in @INC
That's key - you need to understand that the module is *not* in an incorrect location. It's in the correct location for the Perl it was installed under, and your current Perl avoids looking in that location for a good reason. Nothing is broken in that regard. What you need to figure out is why the CPAN shell is finding that module when it shouldn't. OK, I think I'm getting the idea. I have two version of Perl. Some modules are compiled with one version of Perl and won't work with the other. CPAN is running with the older version and reporting that everything's fine, but the scripts are running with the new version and for them, it's not. What would I do, for the sake of argument, if I really wanted to clean up my system and get rid of all traces of Perl 5.8.0 and its installed modules? I thought installing the latest Dev Tools and Perl 5.8.1 would make everything simple and make everything work but apparently not... Have You Validated Your Code? John Horner(+612 / 02) 9333 2110 Senior Developer, ABC Online http://www.abc.net.au/
Re: CPAN installing to somewhere not in @INC
On Jun 10, 2004, at 7:27 PM, John Horner wrote: CPAN is running with the older version and reporting that everything's fine, but the scripts are running with the new version and for them, it's not. That sounds like a PATH issue. Scripts begin with #!/usr/bin/perl, so they use that specific perl. But if you're starting the CPAN shell with 'perl -MCPAN -e shell', then that command will use the first perl to appear in your PATH. And if you're starting the CPAN shell with 'cpan', that script begins with a #! that points to the Perl it was installed with. Run 'echo $PATH' in a terminal to see what your PATH variable is set to. You could also use 'which perl' to see, well, which perl you're running. You could also run 'which cpan', and take a look at the first line of the script that shows you. And 'perl -v' will give you the Perl version - if that's different than '/usr/bin/perl -v', it's definitely a PATH mix-up. What would I do, for the sake of argument, if I really wanted to clean up my system and get rid of all traces of Perl 5.8.0 and its installed modules? 5.8.0? Did you follow Apple's old instructions for installing 5.8.0 on Jaguar, by any chance? If so, it's an easy fix - simply delete everything below /Library/Perl *except* for /Library/Perl/5.8.1 and its subdirectories. And if there's a perl binary and/or cpan script in your PATH before the ones in /usr/bin - I suspect there is, if you followed Apple's old directions, in /usr/local/bin - delete them. I thought installing the latest Dev Tools and Perl 5.8.1 would make everything simple and make everything work but apparently not... If you wanted simple you chose the wrong profession. ;-) sherm--
CPAN installing to somewhere not in @INC
This may be a frequently-asked question, but I've got installed modules which CPAN says are up to date but Perl can't find. @INC contains: /System/Library/Perl/5.8.1/darwin-thread-multi-2level /System/Library/Perl/5.8.1 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1 /Library/Perl /Network/Library/Perl/5.8.1/darwin-thread-multi-2level /Network/Library/Perl/5.8.1 /Network/Library/Perl but when I look for HTML::TokeParser, I find it in /Library/Perl/darwin/HTML/TokeParser.pm so what should I do? I can't see exactly how CPAN (or a previous version of it) decided on that as the install location -- can I change the Config for CPAN to fix that? I know, of course, that I can have use lib to add that to @INC for each script, and I could presumably hack that for the Terminal environment somehow, but I'd rather not -- can I force that into @INC in some kind of system-wide way? One more question, sorry -- if I just copied the TokeParser.pm into the right dir, somewhere Perl *is* looking for it, would that be a problem? Assuming that modules are pure-perl, and don't involved header files and stuff, can I do this? Or will they misbehave because they find themselves in the 'wrong place' and I should just reinstall? Thanks for your patience, jh
Re: CPAN installing to somewhere not in @INC
On Jun 10, 2004, at 6:06 PM, John Horner wrote: This may be a frequently-asked question, but I've got installed modules which CPAN says are up to date but Perl can't find. @INC contains: /System/Library/Perl/5.8.1/darwin-thread-multi-2level ... snip ... but when I look for HTML::TokeParser, I find it in /Library/Perl/darwin/HTML/TokeParser.pm /Library/Perl/darwin is the architecture-specific directory for Perl 5.6 on Jaguar and older. Modules found there will not be compatible with the 5.8.1 version of Perl that you're using. so what should I do? I can't see exactly how CPAN (or a previous version of it) decided on that as the install location -- can I change the Config for CPAN to fix that? A previous version of Perl (correctly!) decided on that, not a previous version of CPAN. (The difference is a bit academic, I know, because CPAN.pm is bundled with Perl...) You cannot fix it because it is not broken. I know, of course, that I can have use lib to add that to @INC for each script, and I could presumably hack that for the Terminal environment somehow, but I'd rather not -- can I force that into @INC in some kind of system-wide way? You could, but that wouldn't allow Perl 5.8.1 to use modules compiled for 5.6. There is a reason that some modules are kept in version- and architecture-specific directories - they don't work with other Perl versions or architectures. One more question, sorry -- if I just copied the TokeParser.pm into the right dir, somewhere Perl *is* looking for it, would that be a problem? Yes. For one thing, there's more to this module than just the .pm file - there's also a .bundle, and there might be some autoload (.al) files or affiliated module (.pm) files as well. Assuming that modules are pure-perl That's an invalid assumption. The architecture-specific subdirectory exists for the purpose of providing a separate location for modules that are *not* pure-perl. Since HTML::TokeParser is in that directory, you should assume it's *not* pure-perl, but has an XS (i.e. a compiled C) component as well as Perl. Modules that are compiled for different major versions of Perl (5.6 vs. 5.8), and/or for different architectures (darwin vs. darwin-thread-multi-2level) are *not* compatible with other versions and/or architectures. So even if you did go to the trouble of figuring out what files to move, moving them wouldn't do any good. I should just reinstall? I'd use a scalpel first, and save the axe for a last resort. ;-) The key question is why the CPAN tool is claiming that this module is up to date when in fact it is not. How are you starting it, with 'cpan' or with 'perl -MCPAN -e shell'? Whichever one you're using, try the other to see if you get the same results. Is there a PERL5LIB in your environment? That's key - you need to understand that the module is *not* in an incorrect location. It's in the correct location for the Perl it was installed under, and your current Perl avoids looking in that location for a good reason. Nothing is broken in that regard. What you need to figure out is why the CPAN shell is finding that module when it shouldn't. sherm--
Re: MacPerl INC question
At 10:48 pm -0500 4/2/04, [EMAIL PROTECTED] wrote: Interestingly, the problem I was trying to solve with MacPerl's SetFileInfo is still open. Once Perl set the creator/type... At 6:23 pm -0500 3/2/04, [EMAIL PROTECTED] wrote: MacPerl::SetFileInfo('CARO', 'PDF', $path); Is that precisely what you are writing? If so then you need 4 bytes in the file type and I guess it should be 'PDF ' JD
Re: MacPerl INC question
In a message dated 2/5/04 12:37:24 AM, [EMAIL PROTECTED] writes: So my next question is: What is Acrobat doing when opening a file that SetFileInfo isn't? Setting the correct file type? :^) According to your previous message, you're doing this: MacPerl::SetFileInfo('CARO', 'PDF', $path); HFS file and creator types are four-bytes long; the file type for PDF is PDF , with a trailing space, not PDF. So try changing the above line to: MacPerl::SetFileInfo('CARO', 'PDF ', $path); and I think you'll be set. Right you are. Thanks for reminding me that it's the small things in life that matter... and it's a spaceband. -Alan
Re: MacPerl INC question
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: #!perl use strict; use warnings; my ($folder,$x,$file,$path); my @files; $folder = :pdf:; This won't work in Mac OS X. You must use Unix paths. opendir(PDF, $folder) || die $!; @files = readdir(PDF); close(PDF); for $x (0..$#files) { $file = $files[$x]; $path = $folder . $file; if (-f $path) { MacPerl::SetFileInfo('CARO', 'PDF', $path); } # END FOR You can use the MacPerl module under Mac OS X, if you install it. Use the CPAN shell: % perl -MCPAN -e shell cpan install MacPerl See man perlmodinstall for more information. -- Chris Nandor [EMAIL PROTECTED]http://pudge.net/ Open Source Development Network[EMAIL PROTECTED] http://osdn.com/
Re: MacPerl INC question
On Feb 3, 2004, at 6:23 PM, [EMAIL PROTECTED] wrote: I've written the following to sweep a folder and set creator/type for pdf files (coming off a Linux server). Standard caveat: Creator/type has been deprecated for Mac OS X, so you really shouldn't need to do this unless these files either lack a proper .pdf extension, or will be used by Macs running older OSes. This works from MacPerl, but I really need to run it from OSX Perl. How do I get Perl to use MacPerl.pm, which @INC can't Mac OS X doesn't need a special Perl - it comes with the standard UNIX Perl. What you need now is the Mac::Carbon package, which includes the MacPerl module. See 'perldoc perlmodinstall' for details, but in a nutshell what you do is download the module from cpan.org (or a mirror site), unpack it (StuffIt should work), and then open a Terminal window and navigate to the unpacked directory. In the terminal window you want to run a series of four commands: perl Makefile.PL make make test make install Make sure to review the output from make test before proceeding to make install - you may not want to install the module if the self-tests fail. If you find yourself needing more than a handful of modules, you'll probably want to use the CPAN shell. It automates the process of downloading, testing, and installing most modules, handling dependencies, etc. I wrote a rather lengthy spiel about it just a couple of days ago, in a thread titled 'many module questions'. You can find it in the archives at http://www.mail-archive.com/macosx%40perl.org/ sherm--
Re: MacPerl INC question
On Tuesday, February 3, 2004, at 05:23 PM, [EMAIL PROTECTED] wrote: I've written the following to sweep a folder and set creator/type for pdf files (coming off a Linux server). This works from MacPerl, but I really need to run it from OSX Perl. How do I get Perl to use MacPerl.pm, which @INC can't locate? ( #!/usr/bin/perl use MacPerl; ... ). If you install MacPerl.pm in the obvious way, then it should be found. Otherwise, if you install it in an alternate location, then you can do: use lib qw(/path/to/where/you/installed/it); use MacPerl; -Ken
Re: MacPerl INC question
I've written the following to sweep a folder and set creator/type for pdf files (coming off a Linux server). This works from MacPerl, but I really need to run it from OSX Perl. How do I get Perl to use MacPerl.pm, which @INC can't locate? ( #!/usr/bin/perl use MacPerl; ... ). If you install MacPerl.pm in the obvious way, then it should be found. Otherwise, if you install it in an alternate location, then you can do: use lib qw(/path/to/where/you/installed/it); use MacPerl; Thanks for pointing me in the right direction. Interestingly, the problem I was trying to solve with MacPerl's SetFileInfo is still open. Once Perl set the creator/type, the file was still not fully recognized as belonging to that application (no icon, and not recognized by the Classic application). It seems that the means for associating the creator/type with this application (Acrobat 5) is either through the Get Info (Opens with...) window (this works in Jaguar), or by simply opening it first with the application (this works in Panther). So for the moment, I'm relying on AppleScript to tell the application to open the file to get it fully associated. So my next question is: What is Acrobat doing when opening a file that SetFileInfo isn't? -Alan
Re: MacPerl INC question
[EMAIL PROTECTED] wrote on 2/4/04 at 10:48p: So my next question is: What is Acrobat doing when opening a file that SetFileInfo isn't? Setting the correct file type? :^) According to your previous message, you're doing this: MacPerl::SetFileInfo('CARO', 'PDF', $path); HFS file and creator types are four-bytes long; the file type for PDF is PDF , with a trailing space, not PDF. So try changing the above line to: MacPerl::SetFileInfo('CARO', 'PDF ', $path); and I think you'll be set. Hope this helps, -- John Gruber | Daring Fireball [EMAIL PROTECTED]|http://daringfireball.net
MacPerl INC question
I've written the following to sweep a folder and set creator/type for pdf files (coming off a Linux server). This works from MacPerl, but I really need to run it from OSX Perl. How do I get Perl to use MacPerl.pm, which @INC can't locate? ( #!/usr/bin/perl use MacPerl; ... ). #!perl use strict; use warnings; my ($folder,$x,$file,$path); my @files; $folder = :pdf:; opendir(PDF, $folder) || die $!; @files = readdir(PDF); close(PDF); for $x (0..$#files) { $file = $files[$x]; $path = $folder . $file; if (-f $path) { MacPerl::SetFileInfo('CARO', 'PDF', $path); } # END FOR
How to add to @INC?
My Perl 5.8.0 resides in /opt/local/bin/. Perl 5.6.0 is in /usr/bin. When I start a script with #!/opt/local/bin/perl -w use Date::Parse; I get an error message because Date::Parse is in /Library/Perl/Date and my Perl 5.8.0 @INC doesn't contain /Library/Perl. I have no problems when I change the script to start with #!/opt/local/bin/perl -w use lib qw(/Library/Perl); use Date::Parse; but this effectively puts /Library/Perl in front of everything in my 5.8.0 @INC array. My question is this. How do I change my Perl 5.8.0 @INC so that it reads like ~/where_ever_I_am /opt/local/lib/perl5/5.8.0/darwin /opt/local/lib/perl5/5.8.0 /opt/local/lib/perl5/site_perl/5.8.0/darwin /opt/local/lib/perl5/site_perl/5.8.0 /opt/local/lib/perl5/site_perl /System/Library/Perl/darwin /System/Library/Perl /Library/Perl ... so that Perl 5.8.0 looks in my /opt/local/ directories first --- and is this advisable? Regards, -- Vic Norton vic at norton dot name
Change to @INC on perl 5.8.1rc3
Compiling perl 5.8.1 release candidate 3 as recommended in INSTALL (rm -f config.sh Policy.sh; sh Configure -de; make; make test; sudo make install) has produced a different @INC to that in release candidate 2: Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Locally applied patches: RC3 Built under darwin Compiled at Jul 31 2003 10:14:45 @INC: /usr/local/lib/perl5/5.8.1/darwin /usr/local/lib/perl5/5.8.1 /usr/local/lib/perl5/site_perl/5.8.1/darwin /usr/local/lib/perl5/site_perl/5.8.1 /usr/local/lib/perl5/site_perl . compare: Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Locally applied patches: RC2 Built under darwin Compiled at Jul 14 2003 10:05:38 @INC: /usr/local/lib/perl5/5.8.1/darwin /usr/local/lib/perl5/5.8.1 /Library/Perl/5.8.1/darwin /Library/Perl/5.8.1 /Library/Perl . Does anyone else see this behaviour? Is this a planned change? Thanks; -- :: paul :: compiles with canadian cs1471 protocol
Re: Change to @INC on perl 5.8.1rc3
On Thursday, July 31, 2003, at 06:31 AM, Paul Mison wrote: Does anyone else see this behaviour? Is this a planned change? if site_perl was somehow left out of RC2, I suspect that was a mistake. The vast majority of modules you install from CPAN will go there. See what's in your @INC for 5.8.0. I have: Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under darwin Compiled at Dec 21 2002 18:20:47 %ENV: PERL5LIB=/usr/local/bricolage/lib @INC: /usr/local/bricolage/lib /usr/local/lib/perl5/5.8.0/darwin /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/darwin /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl HTH, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://kineticode.com/ Yahoo!: dew7e Jabber: [EMAIL PROTECTED] Kineticode. Setting knowledge in motion.[sm]
Re: Change to @INC on perl 5.8.1rc3
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (David Wheeler) wrote: On Thursday, July 31, 2003, at 06:31 AM, Paul Mison wrote: Does anyone else see this behaviour? Is this a planned change? if site_perl was somehow left out of RC2, I suspect that was a mistake. The vast majority of modules you install from CPAN will go there. @INC is populated dynamically, and if you do not have a site_perl, it will not be included. That said, this may have been a change ... and if so, I welcome it. I don't want my local perl putting anything in /Library/, and I always check my hints/darwin.sh to make sure that doesn't happen. -- Chris Nandor [EMAIL PROTECTED]http://pudge.net/ Open Source Development Network[EMAIL PROTECTED] http://osdn.com/
Re: Change to @INC on perl 5.8.1rc3
On 31/07/2003 at 07:28 -0700, David Wheeler wrote: On Thursday, July 31, 2003, at 06:31 AM, Paul Mison wrote: Does anyone else see this behaviour? Is this a planned change? if site_perl was somehow left out of RC2, I suspect that was a mistake. The vast majority of modules you install from CPAN will go there. See what's in your @INC for 5.8.0. I have: Hmm. I don't have a 5.8.0. I only have the stock Apple perl 5.6.0, and perl5.8.1 (currently rc2, which I reverted to.) For 5.6.0, I have: Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under darwin Compiled at Jul 14 2002 04:04:33 @INC: /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl /Network/Library/Perl The only two modules in /usr/local/lib/perl5/site_perl/5.8.1 are those I installed during the few minutes this morning I was running 5.8.1rc3 as my primary Perl. Modules installed when I was running 5.8.1rc2 are in /Library/Perl/5.8.1/ -- :: paul :: compiles with canadian cs1471 protocol
Re: Change to @INC on perl 5.8.1rc3
On Thursday, July 31, 2003, at 9:31 AM, Paul Mison wrote: Compiling perl 5.8.1 release candidate 3 as recommended in INSTALL (rm -f config.sh Policy.sh; sh Configure -de; make; make test; sudo make install) has produced a different @INC to that in release candidate 2: Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Locally applied patches: RC3 Built under darwin Compiled at Jul 31 2003 10:14:45 @INC: /usr/local/lib/perl5/5.8.1/darwin /usr/local/lib/perl5/5.8.1 /usr/local/lib/perl5/site_perl/5.8.1/darwin /usr/local/lib/perl5/site_perl/5.8.1 /usr/local/lib/perl5/site_perl . compare: Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Locally applied patches: RC2 Built under darwin Compiled at Jul 14 2003 10:05:38 @INC: /usr/local/lib/perl5/5.8.1/darwin /usr/local/lib/perl5/5.8.1 /Library/Perl/5.8.1/darwin /Library/Perl/5.8.1 /Library/Perl . Does anyone else see this behaviour? Is this a planned change? It looks like you didn't explicitly specify a prefix to install under. Yes, the change is intentional. In RC2, the default prefix was '/usr'. The '/usr' prefix, whether given explicitly or by default, resulted in the somewhat bizarre layout above, that didn't do either of the things you'd normally expect it to do - it neither updated the system Perl nor actually installed anything under '/usr'. I pointed out the oddity to Jarkko and some folks at Apple, and after much discussion a resolution was found. In RC3, the default is the traditional UNIX layout under '/usr/local'. Specifying a prefix of '/usr' now results in an @INC that uses the standard Apple layout - i.e. '/System/Library/Perl/5.8.1', '/Library/Perl/5.8.1', and '/Network/Library/Perl/5.8.1'. sherm--
2 /Library/Perl in @INC
I just did a perl -e 'print $_\n for @INC' in Terminal and both /Library/Perl and /Network/Library/Perl are listed twice. Why? Riccardo -- mailto:[EMAIL PROTECTED] http://www.riccardoperotti.com
Re: 2 /Library/Perl in @INC
On Thursday, February 27, 2003, at 10:22 AM, Riccardo Perotti wrote: I just did a perl -e 'print $_\n for @INC' in Terminal and both /Library/Perl and /Network/Library/Perl are listed twice. Why? I dunno - it's just compiled that way. It certainly doesn't cause a problem, though. -Ken
Re: 2 /Library/Perl in @INC
Got me, Riccardo. I got doubling doubling as well, two different ways: ~% perl -e 'print $_\n for @INC' /sw/lib/perl5/5.6.1/darwin /sw/lib/perl5/5.6.1 /Library/Perl/darwin /Library/Perl /Library/Perl . ~% perl5.6.0 -e 'print $_\n for @INC' /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl . Regards, Vic /Network/Library/Perl . At 11:22 AM -0500 2/27/03, Riccardo Perotti wrote: I just did a perl -e 'print $_\n for @INC' in Terminal and both /Library/Perl and /Network/Library/Perl are listed twice. Why? Riccardo -- mailto:[EMAIL PROTECTED] http://www.riccardoperotti.com
Re: 2 /Library/Perl in @INC
On Thursday, Feb 27, 2003, at 08:22 US/Pacific, Riccardo Perotti wrote: I just did a perl -e 'print $_\n for @INC' in Terminal and both /Library/Perl and /Network/Library/Perl are listed twice. Why? about the only reasonablish reason I can think of would be that they did not do a 'version' based solution for the site_lib hence you would have expected to see something like /Library/Perl/darwin /Library/Perl/5.6.0 /Library/Perl If you check the Config.pm you will note these things. eg: [jeeves: 69:] perl -MConfig -e 'print $Config{sitelib_stem} \n' /Library/Perl [jeeves: 70:] perl -MConfig -e 'print $Config{sitelibexp} \n' /Library/Perl [jeeves: 71:] vice say: vladimir: 53:] perl -MConfig -e 'print $Config{sitelib_stem} \n' /usr/local/lib/perl5/site_perl vladimir: 54:] perl -MConfig -e 'print $Config{sitelibexp} \n' /usr/local/lib/perl5/site_perl/5.6.1 vladimir: 55:] you can then also test the vendorlib side of the process. [jeeves: 71:] perl -MConfig -e 'print $Config{installvendorlib} \n' /Network/Library/Perl [jeeves: 72:] HTH. ciao drieux ---
Mac::MoreFiles breaks @INC (MacPerl 5.6.1)
Hi, Using MacPerl 5.6.1 under Classic (not Mac OS X perl), I've noticed that loading Mac::MoreFiles alters @INC, as the following script demonstrates: --- script use lib qw(lib); print Before, \@INC:\n, map * $_\n, @INC; eval 'use Mac::MoreFiles'; print After, \@INC:\n, map * $_\n, @INC; --- output Before, @INC: * lib * Junior:Applications (Mac OS 9):MacPerl :lib:MacPPC: * Junior:Applications (Mac OS 9):MacPerl :lib: * Junior:Applications (Mac OS 9):MacPerl :site_perl: * : * Dev:Pseudo: After, @INC: * lib: * Junior:Applications (Mac OS 9):MacPerl :lib:MacPPC: * Junior:Applications (Mac OS 9):MacPerl :lib: * Junior:Applications (Mac OS 9):MacPerl :site_perl: * : * Dev:Pseudo: --- That lib: is a problem, because it refers to the root level directory of a volume called lib, not a directory called lib relative to the current directory. Any other use Foo; statements that need to look in lib fail after this point. What I really need is a way to do use lib qw(:lib:); in a cross-platform way, and apparently use lib qw(lib); isn't going to work as well as I'd hoped with 5.6. As a workaround, I'm doing use lib File::Spec-catdir('lib');, which seems to work. It looks like lib.pm handles this case explicitly in 5.8 - unfortunately 5.6's doesn't, and lib.pm has identical version numbers in 5.8 and 5.6 despite extensive changes in this area. -Ken
Re: Adding path to @INC for use with web server
Well yes, that¹s why I don't want to have local info, like where to look for modules, in my script. adam We recently discussed Portability on this list. If you want to write scripts that run on other systems then you have to accommodate that design goal with code. -- Bill Stephenson www.SecureShopper.com 1-417-546-5593 From: Adam Witney [EMAIL PROTECTED] Date: Thu, 10 Oct 2002 11:09:38 +0100 To: MacOS X perl [EMAIL PROTECTED] Subject: Adding path to @INC for use with web server Hi, Searching the archives I have been able to find out how to get Perl to search other paths for modules when invoked from the terminal or from GUI apps such as BBEdit, however I cannot get them recognised by cgi scripts.. I read somewhere to add this line to httpd.conf PerlSetEnv PERL5LIB /sw/lib/perl5 However that doesn't seem to help I could just add use lib 'path'; to the top of each script, but these scripts will be moved to other OS's so I don't want to have to add lines for this purpose Any ideas on how to do this? Thanks adam -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Re: Adding path to @INC for use with web server
From: Adam Witney [EMAIL PROTECTED] Date: Thu, 10 Oct 2002 11:09:38 +0100 To: MacOS X perl [EMAIL PROTECTED] Subject: Adding path to @INC for use with web server Hi, Searching the archives I have been able to find out how to get Perl to search other paths for modules when invoked from the terminal or from GUI apps such as BBEdit, however I cannot get them recognised by cgi scripts. I read somewhere to add this line to httpd.conf You can include this code in httpd.conf: Perl use lib ''; /Perl I assume that this directive requires mod_perl Alternatively you can do PerlRequire /../../perl_config_file.pl and then in that perl config file, include your 'use lib' code.
Re: Permanently add INC directory? - summary
Is there any way to globally add an INC directory to Perl after compilation? But it doesn't get set when I run Perl from within BBEdit or cron. Is there any way to do this so it is truly global (it can just be across me as the user or for all users, since I'm the only user anyway, as long as that will work with things like BBEdit and cron). [I did not want to add it to every script because I want my scripts to be machine independent and my system to define where the libraries are at] Answer 1 from Dan Kogai Jerry Levan: Add the line: push INC , /my/custom/path; or better: use lib '/my/custom/path'; to the start of all affected scripts. This works everywhere, but you have to add this in to each perl script. You could use the FindBin module to make it based on where the script is which would improve it, but it does add a bunch of guf at the front of each script. Answer 2: add the line setenv PERL5LIB /my/custom/path to your .cshrc This works from scripts run from the terminal, but not from BBEdit or cron. Answer 3 from David Wheeler Rick Frankel: You can get set PERL5LIB in ~/.MacOSX/environment.plist. When you set environment variables there, they are set for the OS X GUI as well as for the shell, so it'll work in BBEdit, for example. ?xml version=1.0 encoding=UTF-8? !DOCTYPE plist SYSTEM file://localhost/System/Library/DTDs/PropertyList.dtd plist version=0.9 dict keyPERL5LIB/key string/my/custom/path/string /dict /plist This does not work in cron, and apparently there is a slight overhead to using environment variables. You must logout and log back in for this to take effect. Answer 4 from Rick Frankel: For cron, you can set environment variables in the crontab, just add the line: PERL5LIB=/my/custom/path to the start of the crontab - or better yet, use the CronniX application and configure the Environment variables via the menu command. So essentially, you could use Answer 1, or all of Answers 2, 3 and 4. Enjoy, Peter. -- http://www.interarchy.com/ ftp://ftp.interarchy.com/interarchy.hqx
Re: Permanently add INC directory?
Is there any way to globally add an INC directory to Perl after compilation? I know about setenv PERLLIB5 and do that in my .cshrc. But it doesn't get set when I run Perl from within BBEdit or cron. Is there any way to do this so it is truly global (it can just be across me as the user or for all users, since I'm the only user anyway, as long as that will work with things like BBEdit and cron). Thanks, Peter. In a pinch you could do something like: push INC , Pathtofile At the top of your program, you might have to use A Begin block to enclose the push for use access Rather than require access. --Jerry
Re: Permanently add INC directory?
On Monday, April 22, 2002, at 11:50 , Levan, Jerry wrote: Is there any way to globally add an INC directory to Perl after compilation? I know about setenv PERLLIB5 and do that in my .cshrc. But it doesn't get set when I run Perl from within BBEdit or cron. Is there any way to do this so it is truly global (it can just be across me as the user or for all users, since I'm the only user anyway, as long as that will work with things like BBEdit and cron). Thanks, Peter. In a pinch you could do something like: push INC , Pathtofile At the top of your program, you might have to use A Begin block to enclose the push for use access Rather than require access. More elegant solution; use lib qw(/your/directory); Dan the Man with Too Many perlvar manglings these days