[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] How can you get runtimes to find modules loaded with 'use' ?



Folks:

I have a script which begins like this:

      use AnyDBM_File;
      use Fcntl;

      tie(%T,AnyDBM_File,'Development:testit',O_RDWR|O_CREAT,640)
           || die "can't open db file: $!\n";

       ...

The script runs under the macperl application, creating the DB file as
expected.  However, when I save the file as a runtime (setting the @INC
array by hand), I can't get the program to find the module files in the
lib directory with the 'use' command.  NOTE that the program *CAN* find
the modules with the 'require' command; that is, the following statment
*does not* cause the program to stop:

      require AnyDBM_File.pm || die "can't open AnyDBM_File\n";

Substituting 'require' for 'use' works partly; in a runtime (*only*) the
tie command fails if the DB file does not already exist.

Although I am using the MacPerl 5.0.7r1m application, I encountered this
same problem with the previous version (5.0.6r1m).  I have duplicated
the problem on two different macs, a IIci and a Centris 650.

I would appreciate it if someone could help me out with this.  Let me
know if this is a bug, or give me an example of a runtime which can
create a DB file.

PS: Is it possible to "save" the MacPerl application's library path
    in a runtime so that it doesn't have to be explicitely set within
    a script?

------------------------------------------------------------------------------
| Toni Harbaugh-Blackford           | Internet: helpuser@ncifcrf.gov         |
| Scientific Applications Analyst   |                                        |
| Biomedical Supercomputing Center  | Phone:  (301) 846-5555                 |
| SAIC                              | FAX:    (301) 846-5762                 |
| NCI-FCRDC                         |                                        |
| PO Box B, Bldg 430                |                                        |
| Frederick, MD 21702-1201   USA    |                                        |
------------------------------------------------------------------------------