@INC

2006-01-05 Thread The Ghost
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

2006-01-05 Thread Doug McNutt
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

2006-01-05 Thread John Delacour

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

2006-01-05 Thread The Ghost
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





Finding the current user

2006-01-05 Thread James Reynolds
I know I can get this with `whoami`, but I was wondering if there was 
a Perl way to find the user who executed the script.  I basically 
want to make it so my script is executable by normal users, but 
prints an error if it is not only the root user.


--

Thanks,

James Reynolds
University of Utah
Student Computing Labs
[EMAIL PROTECTED]
801-585-9811


Re: @INC

2006-01-05 Thread Joel Rees


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







Re: Finding the current user

2006-01-05 Thread Sherm Pendley

On Jan 5, 2006, at 6:04 PM, Sherm Pendley wrote:


If you need more than the numeric user ID, have a look at:

perldoc getpwnam
perldoc User::pwent


D'oh! getpwnam() is a function (not a module), so that should be:

perldoc -f getpwnam
perldoc User::pwent

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org