Lou Hernsen <mailto:[EMAIL PROTECTED]> wrote:

: I am studying modules.. I am seeking a mentor to help.

    What do you mean by "module"? I ask because many people have very
different ideas about what one is.

    For example, some people think about a library.

require 'my_perl_module.pl";


    When I say "module", I am usually thinking of an object.

use TemplateVariables;

my $vars = TemplateVariables
            -> new()
            -> select_categories();


    Others think of a library of subroutines and variables.

use CGI qw(:standard center);

print
    header(),
        start_html('foo'),
            center(h1('foo')),
        end_html();

    In your own words, define "module."


: I have very simple questions like ...
: Do I need to pass vars into the mod?

    That depends on what you are attempting to do. It also depends
on what you want the module to do. The CGI example above passed
variables into the module to tell it which subroutines should be
exported. An object may require variables to be added when it is
constructed.


: Do i need to declare vars in the mod?

    It is often very difficult to write an entire module without
declaring a variable, but it is not impossible.


: What is "our"? something like "my" and "local"?

     Yes. Have you read perlfunc?


: Do I need to return vars?

    Not usually. Most modules return values.

 
: The code I am writing creates part of a web page,
: so I can print it in the mod or in the main.
: (I wold prefer to print it in the mod.. if possible)
: 
: I have been reading for 2 weeks now and can't find a simple working
: model to disect that I can understand all the parts of.

    Give us  a more detailed idea of what you are attempting and
perhaps we could write an example for you.


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328

 . . . With Liberty and Justice for all (heterosexuals).


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to