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

RE: Modules

by KM (Priest)
on May 24, 2000 at 23:30 UTC ( #14644=note: print w/ replies, xml ) Need Help??


in reply to Modules
in thread Stock Quotes

It is good to have fun and learn. And, have fun learning. One of the reasons I have done Perl all these years is that I always have fun with it, unlike other languages where I didn't find it fun to be using and writing.

Anyways, don't be hesitant to use modules that aren't part of the distrobution. There is a lot of useful modules out there that will save you time and headaches. To learn, it is always good to read the modules POD and source to see what makes it tick.

Unless you are using a module which is specific to Win32, or *nix specific, then don't worry about portability. Many modules work fine on many platforms. If you have a reluctant sysadmin, you can still install modules under your home directory. Then you can change @INC to look there, or PERL5LIB.

In order to allow users to install their own modules I have sometimes aliased 'perl' with 'perl -I/path/to/their/modules' which has worked nicely.

Hope this helps.

Cheers,
KM


Comment on RE: Modules
Re: RE: Modules
by Elliott (Pilgrim) on Oct 10, 2001 at 19:53 UTC
    KM says: If you have a reluctant sysadmin, you can still install modules under your home directory. Then you can change @INC to look there, or PERL5LIB.

    I am sorry this question is begging for an RTFM answer, but please be gentle with me! I have been looking for the right M to FR for many months!

    Pretty please, can someone explain what KM said in simpler words? Or tell me where to find a real newbie's guide to installing modules?

    Firstly, what does "home directory" mean? Is this cgi-bin or the directory which contains it?

    Secondly, what does "change @INC to look there" mean. What is @INC and how do I change it? And will I still be able to use the sysadmin's modules?

    I am using Perl remotely on my webhost's server.
      Firstly, what does "home directory" mean? Is this cgi-bin or the directory which contains it?

      Read the Unix manual. It's the directory you start in when you log into your webhost.

      Secondly, what does "change @INC to look there" mean. What is @INC and how do I change it? And will I still be able to use the sysadmin's modules?

      @INC is the list of directories that Perl uses to find the modules you requested that it bring into your script, like CGI or IO::File or whatever. You modify it by doing a

      use lib '/this/directory/has/neat/modules';
      @INC lookups are done last added first. Thus, if you added a directory, but the module you're use-ing or require-ing isn't there, it looks in the next entry in @INC. You already have a number of entries that are default. use lib 'somedir'; simply says "Look here first. If it isn't here, then look where you would've looked if I hadn't done this."

      As for you installing your own modules ... Learn more about Unix first. It sounds like you're a newbie to Unix in general. You'll have more headaches installing modules than you know what to do with. Of course, if you don't mind that, you'll learn a heck of a lot about Unix installing modules...

      As for learning Unix, go to a local library and borrow some books. It's a big learning curve, so don't expect to be an expert in a week, month, or even a year. But, you can expect to become at least proficient in a week or two.

      ------
      We are the carpenters and bricklayers of the Information Age.

      Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-12-21 09:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls