Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: What are Modules

by xunker (Beadle)
on Dec 07, 2001 at 23:40 UTC ( #130283=note: print w/replies, xml ) Need Help??


in reply to What are Modules

Let's take things ong at a time, eh? I think you're going to want explainations in basic terms, and that's what I'm good at -- writing things in painfully terse form :)

* What is a module? - A module is basically a collection of subrouties that is not a program by itself, but is used by other programs. It's all about code recuse and astetics. The calling program accesses and uses the subrouting inside the module.

* How do i use it - You just said it: use module_name; or require module_name; Use and Require are similar but have different nuances, so 'use' would be your best bet. Put 'em up near the begining of the program.

* What is CPAN? - CPAN: A networked storage system of Perl Modules. It combines the Storage of the modules, managment and instalation into come seamless package. When people say 'use CPAN', they usually mean do (as root usually) "perl -MCPAN -e shell", which gets you into the CPAN shell where you can install perl modules with a few keystrokes. You want to install NET::IRC? Just type 'install NET::IRC'. It's very slick.

Module != CPAN. You can write you own modules in your own code, and I recommend that you do. CPAN is just a repostory of Generic and useful modules other people have written.

* how does it tie into a module - If you write a module that is usful enough that others would like it, you can bundle it up and put it on the CPAN network for other people to use.

* is their someplace here that can teach me all about modules and using them? - Here would be a great place to start. Using modules is pretty easy, you've probably already seen it/done it and not even known it. Making modules is harder, but worth learning if you want to write high-quality code.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2020-05-29 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (166 votes). Check out past polls.

    Notices?