sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
I just have a few basic questions that I'm sure the monks here wouldn't have any problem answering.
The only difference between a package and a module is the extension of .pm and and the module requires the package name? Is that right?
A module is nothing more than Perl code it looks like. I thought it was a lot different from looking at some posts in here showing them. I guess what made me think they were more complicated was the =HEAD NAME and =HEAD DESCRIPTION type headings. The example I was looking at is Text::Tab since it's a small module and this appears at the BOTTOM of the script. Are these required and what are their purpose? The tutorials I found didn't list these and I don't believe this is induced in the script. Maybe it's just for people to read when they view the source code?
Now comes down to the theory behind using modules.. I know there is a difference between use and require, but when it comes to using variables inside the module should we be using $_ or @_ more often than predefined names? Or how does our data imported from our script into the module if it requires specific names? (note: I know some modules have their own variables to use).
Thanks for all your help, wise monks! I'm sure when I venture deeper into this I'll have more questions on the topic.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Creating modules
by PodMaster (Abbot) on Mar 25, 2004 at 08:58 UTC | |
|
Re: Creating modules
by Abigail-II (Bishop) on Mar 25, 2004 at 08:28 UTC | |
|
Re: Creating modules
by samtregar (Abbot) on Mar 25, 2004 at 08:03 UTC | |
by Jaap (Curate) on Mar 25, 2004 at 11:53 UTC | |
|
Re: Creating modules
by leriksen (Curate) on Mar 25, 2004 at 08:15 UTC | |
|
Re: Creating modules
by pelagic (Priest) on Mar 25, 2004 at 07:51 UTC | |
|
Re: Creating modules
by Aragorn (Curate) on Mar 25, 2004 at 09:26 UTC | |
by Anonymous Monk on Mar 25, 2004 at 12:32 UTC | |
by QwertyD (Pilgrim) on Mar 25, 2004 at 15:50 UTC |