The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Compare/Diff between directories and subdirectories? andylee80 UNIX for Dummies Questions & Answers 5 07-12-2007 09:45 AM
perl package question hankooknara Shell Programming and Scripting 1 06-26-2007 09:49 PM
perform diff between 2 directories umen UNIX for Dummies Questions & Answers 5 08-25-2006 11:55 AM
how to change working directories in perl? megastar Shell Programming and Scripting 1 11-02-2005 03:05 PM
perl: globals and a package. effigy Shell Programming and Scripting 6 12-22-2004 08:47 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-23-2004
gusla gusla is offline
Registered User
  
 

Join Date: Feb 2002
Posts: 31
perl package directories - what if the script is diff DIR to the one contain *.pm?

Hi there,

say the package is in the ~/ and it's ~/packageFoo.pm

I can use usePackage.pl in ~/ (~/usePackage.pl).

Now, if I move it to ~/subDIR/usePackage.pl, the script won't work because it's not in the same DIR with packageFoo.pm

How can i fix it?

Thanks

Gusla
  #2 (permalink)  
Old 11-23-2004
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
Two ways.

Just amend the include path at the top of your script, i.e. @INC

e.g.

Code:
@INC = ('..', @INC);
Maybe to cause it to take effect early (before execution) by

Code:
BEGIN {
	@INC = ('..', @INC);
}
which is essentially the same as the Perl pragma "use lib" :

e.g.

Code:
use lib '..';
More information:
http://theoryx5.uwinnipeg.ca/CPAN/perl/lib/lib.html
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:13 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0