*nix Perl newbie Question

2004-02-15 Thread wren argetlahm
So I finally made the switch from MacPerl to Perl
5.8.3 on OSX (10.2.8) and I can't seem to get things
working quite right. I'm having problems using
modules.

% perl -I ~/lib script.pl
#!perl
use module;

...(or moral equivalent) works fine but:

% ./script.pl
#!perl -I ~/lib
use module;

...and:

% ./script.pl
#!perl
use lib '~/lib';
use module;

...both return the error that they can't find the
module, even though @INC is modified as it should be.
What's up?

~wren

__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html


Re: *nix Perl newbie Question

2004-02-15 Thread Sherm Pendley
On Feb 15, 2004, at 5:33 PM, wren argetlahm wrote:

% ./script.pl
#!perl -I ~/lib

...both return the error that they can't find the
module
Are you *sure* that's the error you're getting? If the above #! line is 
straight out of your script, you'll be getting a 'command not found' 
error - which is an entirely different animal.

Assuming you want to use the 5.8.3 you just installed, the #! (shebang) 
line should read like this:

#!/usr/local/bin/perl

sherm--



Re: *nix Perl newbie Question

2004-02-15 Thread wren argetlahm

--- Sherm Pendley [EMAIL PROTECTED] wrote:
 Are you *sure* that's the error you're getting?

the actual shebang line is:

#! /usr/local/bin/perl -I ~/Library/Perl

The error is:

Can't locate WREN/Numbers.pm in @INC (@INC contains: 
~/Library/Perl [...snip...]) at ./t.plx line 3.
BEGIN failed--compilation aborted at ./t.plx line 3.

~wren

__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html


Re: *nix Perl newbie Question

2004-02-15 Thread Doug McNutt
I worry that the ~/ convention for the home directory is a shell convention. In the 
first case it is expanded by the shell while in the other cases it's expanded by perl. 
Does perl honor the option? When you say @INC is properly modified is the expansion 
done in the list as displayed?

In either case I'd try a full pathname because it's an easy thing to do.


At 14:33 -0800 2/15/04, wren argetlahm wrote:
% perl -I ~/lib script.pl
#!perl
use module;

(or moral equivalent) works fine but:

% ./script.pl
#!perl -I ~/lib
use module;

and:

% ./script.pl
#!perl
use lib '~/lib';
use module;

both return the error that they can't find the
module, even though @INC is modified as it should be.

-- 
--  There are 10 kinds of people:  those who understand binary, and those who don't 
--


Re: *nix Perl newbie Question

2004-02-15 Thread wren argetlahm

--- Doug McNutt [EMAIL PROTECTED] wrote:
 I worry that the ~/ convention for the home
 directory is a shell convention. In the first 
 case it is expanded by the shell while in the 
 other cases it's expanded by perl. Does perl 
 honor the option? When you say @INC is properly 
 modified is the expansion done in the list as 
 displayed?

It doesn't expand in the error message, spelling it
out fixed the problem though. Thanks for the help.

~wren

__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html