Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Module Path Problem

by bigup401 (Pilgrim)
on Nov 18, 2014 at 17:00 UTC ( [id://1107595]=perlquestion: print w/replies, xml ) Need Help??

bigup401 has asked for the wisdom of the Perl Monks concerning the following question:

i have a problem, i was hosting my pl page, and my hosting provider does not have the module which i used, so i was telling my script to look for module in dir

use lib '/webdir/Auth'; use Auth::OATH;

bt it does not work

Replies are listed 'Best First'.
Re: Module Path Problem
by choroba (Cardinal) on Nov 18, 2014 at 17:04 UTC
    What error do you get? Is the module correctly installed in /webdir/Auth (i.e. /webdir/Auth/Auth/OATH.pm exists)? Does the webserver user have permissions to read the directory?
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      the chmod is 755
Re: Module Path Problem
by MidLifeXis (Monsignor) on Nov 18, 2014 at 17:29 UTC

    Is it '/webdir/Auth', or '../../webdir/Auth'? '../..' is replaced with the base directory of your library directory relative to your .pl script.

    Note: "it does not work" is usually not a very good or informative error message. Including the message from your error log and/or browser will likely be helpful.

    --MidLifeXis

      lets say domain.com/folder1/Authen/OATH.pm #this is the module location so am calling the module like this

      use lib '/folder1'; use Authen::OATH;

        and where is your CGI script / .pl page, using the same domain.com/folder1/.... example? As it stands, you are asking for the script to search in the root directory available to the .pl script. I am guessing that this is not the case, unless some chroot magic is happening.

        --MidLifeXis

        Place this script in the same folder as your .pl script and browse it.
        #!/usr/bin/perl # cwd.pl use strict; use CGI; use CGI::Carp 'fatalsToBrowser'; use Cwd; my $q = new CGI; print $q->header, $q->start_html(), $q->pre(cwd()), $q->end_html;

        What path is displayed?

        poj

Re: Module Path Problem
by Loops (Curate) on Nov 18, 2014 at 17:14 UTC

    Modules are searched within subdirectories where you see "::" in their name. As a shot in the dark, i'm guessing that you want:

    use lib '/webdir';

    And if you look on disk you'll see the file: '/webdir/Auth/OATH.pm'

      yes i also tried that

      use lib '/webdir/'; use Auth::OATH;

      bt it failed

      the chmod is 755

        " it failed "

        Oh? "failed" HOW?

        Tell us -- verbatim -- the warnings, error messages and/or -- in narrative -- how it "failed"; how you know that; and how whatever happened falls short of your desires.

        The Monastery's crystal ball is undergoing an upgrade (in the hope we can eventually make it work) but right now, "it fail(s)."


        Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
        1. code
        2. verbatim error and/or warning messages
        3. a coherent explanation of what "doesn't work actually means.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1107595]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-20 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found