Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: CGI script organisation

by dws (Chancellor)
on Jan 27, 2002 at 10:47 UTC ( [id://141887]=note: print w/replies, xml ) Need Help??


in reply to CGI script organisation

But I can't figure out how to get the use operator to take a relative path (such as ../).

Use an absolute path. Something like   use lib qw(/home/LukeBoy/modules);

Replies are listed 'Best First'.
Re: Re: CGI script organisation
by LukeyBoy (Friar) on Jan 27, 2002 at 10:49 UTC
    But if the module gets relocated (which it surely will when I release it) that'll mess everything up. Who knows where other users will install the stuff?
      Why not create a modules subdirectory below your app so that you can do this.
      use mod_dir::module1; use mod_dir::module2; module1->foo(); module2->foo2();

      metadoktor

      "The doktor is in."

        I advise against that.
        use mod_dir::module1;
        equates to
        BEGIN { require mod_dir::module1; import mod_dir::module1; }
        Notice the import? That will break if the actual namespace is called module1, and not mod_dir::module1. Depending on the module, this can have a huge impact.

        Makeshifts last the longest.

        That's good too. I can use a dummy .htaccess file to block users from inadvertanly entering that directory.
      But if the module gets relocated (which it surely will when I release it) that'll mess everything up.

      Then your install procedure will need to plug in a correct path.

        Yeah, this is one way to do it. I can let the configure script process example.pl.in to example.pl to replace the paths with their actual values. It's ugly, but it'll do. Thanks!

Log In?
Username:
Password:

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

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

    No recent polls found