On Thu, Nov 07, 2002 at 02:26:24PM -0800, George Szynal wrote:
> Since then I have discovered that installing with admin rights is required
> for the app to run.
> 
> EXPECTED RESULT:
> regardless of how we installed, if mathServer.pm and mathClient.pm
> use mathSystem;
>    ...rather than...
> use lib mathSystem;

use lib adds directories for Perl to search for modules.  It takes a list of
directories as an argument, not a Perl module.  

Assuming the layout of your programs and modules is something like:

    /path/to/your/product_dir/your_program
    /path/to/your/product_dir/lib/mathSystem.pm

This information is available via "perldoc lib".

Your proper usage would likely be:

    use lib '/path/to/your/product_dir/lib/';
    use mathSystem;

Alternatively, you can do it relative to the location of the program itself.
First you have to find where the program is installed using FindBin and the
resulting $FindBin::Bin variable.

    use FindBin;

    # $FindBin::Bin contains /path/to/your/product_dir which is where
    # your_program is located.
    use lib "$FindBin::Bin/lib";
    use mathSystem;

Perl will now find mathSystem.pm in /path/to/your/product_dir/lib/.


>    ...the app should run OK after moving the auto directory under the
> product directory.

Unless you're using an AutoLoader or XS code there should be no auto/
directory.  Likely you have a "use AutoLoader" in your module which it's not
using (probably generated from the original h2xs template) and is creating
an empty stub directory.


> 3. App did NOT work, even the Server failed to launch.

How did the app not work?  Did it punch out early?  Did it take a sick day?
Did it go on strike? ;)

A simple way to figure out if things are installed correctly is to write a
small program in /path/to/your/product_dir/ which attempts to use mathSystem
and checks what $mathSystem::VERSION you have and where it came from by
printing $INC{"mathSystem.pm"}.  This smaller program will be easier to
debug and understand what's going on WRT module locations and loading than
the full system.


>   RESULTING data point: Installing as ROOT provides a service that we need,
> which we don't fully understand.

Installing as root should not be consequential.  Stop shuffling .pm files
around by hand and reinstall something like this:

    perl Makefile.PL PREFIX=/path/to/your/product_directory 
LIB=/path/to/your/product_directory/lib
    make test
    make install

Alternatively, if the PREFIX/LIB stuff just isn't working for some reason,
you can do a manual install by doing...

    perl Makefile.PL
    make
    make test

and then copying the entire contents of blib/ (the build directory from
which MakeMaker installs) to /path/to/your/product_directory/lib/


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
<GuRuThuG> make a channel called #Perl, and infest it with joking and 
           fun.... it doesnt make alot of sense.

Reply via email to