Can't find the Modules Lib 
Author Message
 Can't find the Modules Lib

This works fine on a machine with perl5; the Getopt module is found in
a lib that's in the INC path:

#!/usr/bin/perl
use Getopt::Std;
getopt('de');
print "debug  trace on\n" if $opt_d;

A machine where I'd like to run perl5 (but where I don't control the
machine) is still at perl4 and can't be upgraded for a while. Fortunately
I have the space to install in my user account.  It works for HelloWorld
but I'm having no luck including the standard libraries.  Trying

#!/users/siler/perl5.002/perl


use Getopt::Std;

I get

BEGIN failed--compilation aborted at optdem.pl line 5.


/users/siler/perl5.002/lib/opt/perl5/lib/PA-RISC1.1/5.002etcetc
which is where the library is (the other libs are apparently
from an earlier attempt to install)
Suggestions would be greatly appreciated. I feel I'm missing something simple.



Wed, 26 May 1999 03:00:00 GMT  
 Can't find the Modules Lib

Quote:

> This works fine on a machine with perl5; the Getopt module is found in
> a lib that's in the INC path:

> #!/usr/bin/perl
> use Getopt::Std;
> getopt('de');
> print "debug  trace on\n" if $opt_d;

> A machine where I'd like to run perl5 (but where I don't control the
> machine) is still at perl4 and can't be upgraded for a while. Fortunately
> I have the space to install in my user account.  It works for HelloWorld
> but I'm having no luck including the standard libraries.  Trying

> #!/users/siler/perl5.002/perl


> use Getopt::Std;

> I get

> BEGIN failed--compilation aborted at optdem.pl line 5.


> /users/siler/perl5.002/lib/opt/perl5/lib/PA-RISC1.1/5.002etcetc
> which is where the library is (the other libs are apparently
> from an earlier attempt to install)
> Suggestions would be greatly appreciated. I feel I'm missing something
> simple.

The standard advice is to use either:

or
        use lib "/users/siler/perl5.002/lib";

-Tom



Wed, 26 May 1999 03:00:00 GMT  
 Can't find the Modules Lib

Quote:

>#!/users/siler/perl5.002/perl


>use Getopt::Std;

>I get

>BEGIN failed--compilation aborted at optdem.pl line 5.


>/users/siler/perl5.002/lib/opt/perl5/lib/PA-RISC1.1/5.002etcetc
>which is where the library is (the other libs are apparently
>from an earlier attempt to install)
>Suggestions would be greatly appreciated. I feel I'm missing something simple.

Yep  -  'fraid you are.   It's the old compile time / run time trap.
use happens at compile time; unshift doesn't happen till run time.

Get out of that 'unshift' habit.   The modern way to add libraries is

         use lib "/users/siler/perl5.002/lib";
         use Getopt::Std;

Mike Guy



Thu, 27 May 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Can't find the Modules Lib

2. Can't get Perl to find modules in Lib directory when compiling

3. Can't install Net module using ppm - Can't find module

4. can't find db.h lib.db

5. module A can't find functions in module B

6. Module File::Find and 'prune' variable

7. Q: Tests op/misc, op/write, lib/ndbm, lib/posix, lib/sdbm failed

8. Can't find loadable object for module Win32::ODBC error

9. can't find this module Net::YahooMessenger

10. Perl can't find modules

11. Can't find Net::SNMP module?

12. Can't find some modules

 

 
Powered by phpBB® Forum Software