simple, stupid perl package Q

J

Joseph Cipale

I have written a package in perl, and I want to include it in a script
I am developing. I have it in my /home/joec/public_html/cgi directory.

When I try to invoke the script to test the pacakge inclusion, I get the
following message:
Can't locate CGILib/Error.pm in @INC (@INC contains:
/usr/lib/perl5/5.6.0/i686-linux /usr/lib/perl5/5.6.0
/usr/lib/perl5/site_perl/5.6.0/i686-linux /usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl/5.005 /usr/lib/perl5/site_perl) at catbird.cgi
line 19.

In my .cshrc file, I have set the PERL5LIB env var to my path where the
package
module is located. Is there anything else I can do/should do to get this
to work?

Regards,

Joe Cipale
--
#----------------------------------------------------------#
# "Don't fear the penguin!" #
#----------------------------------------------------------#
# Registered Linux user: #309247 http://counter.li.org #
#----------------------------------------------------------#
 
E

Eric Schwartz

Joseph Cipale said:
I have written a package in perl, and I want to include it in a script
I am developing. I have it in my /home/joec/public_html/cgi directory.

When I try to invoke the script to test the pacakge inclusion, I get the
following message:
Can't locate CGILib/Error.pm in @INC

Two things are possible:

1) When you

use CGIlib::Error;

Perl searches @INC for a directory which itself contains the file
'CGIlib/Error.pm'. If you have Error.pm in ~/public_html/cgi, then it
won't find it in the right place.

2) Did you 'setenv PERL5LIB ~/public_html/cgi' ? in csh, IIRC, you
have to use setenv to make sure the variable is exported to
subshells; if you use 'set', it's only valid in the current shell.

3) Much easier than setting PERL5LIB is to

use lib '/home/joec/public_html/cgi';

That adds the given directory to @INC.

-=Eric, hopes he remembers enough csh for that to make sense
 
J

John Strauss

I have written a package in perl, and I want to include it in a script
I am developing. I have it in my /home/joec/public_html/cgi directory.

When I try to invoke the script to test the pacakge inclusion, I get the
following message:
Can't locate CGILib/Error.pm in @INC (@INC contains:
/usr/lib/perl5/5.6.0/i686-linux /usr/lib/perl5/5.6.0
/usr/lib/perl5/site_perl/5.6.0/i686-linux /usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl/5.005 /usr/lib/perl5/site_perl) at catbird.cgi
line 19.

In my .cshrc file, I have set the PERL5LIB env var to my path where the
package
module is located. Is there anything else I can do/should do to get this
to work?

Regards,

Joe Cipale


try this. add this line below the shebang line,
but before you call your package:

use lib '/home/joec/public_html/cgi';


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drop the .thetenant to get me via mail
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top