Lou Hernsen <> wrote:

: Bob Showalter <> wrote:
: 
: : A variable declared with "my" is only accessible within the
: : enclosing file, block, or eval.
: 
: File is the entire program.

    Yes.

: like a global var?

        No. Globals are in the symbol table and can be accessed from
*outside* the file. File scoped lexicals can only be accessed
from *inside* the file.


: Block is the "if" or "while" or other {} framed code?

    Yes.


: what is an eval?

        A perl function. Read perlfunc or type "perldoc -f eval" from   
the command line (DOS box).


: : "our" is a declaration that allows you to use a global
: : (symbol-table) variable name without a package qualifier when
: : "use strict" is in effect. 
: 
: from what you say "our" is used in the main program

    It can be used in any file. The main program or a module which
uses the "strict" module.


: so I don't have to declare them again in the mod?

        No. You should be importing the module subroutines into the
"main" namespace. So your program will "think" the subroutine and
variables are from "main".

    If you are not using "strict" you don't need "our".


: So if I run the mod as one big ad-in program to main
: and not calling subs in the mod, I don't have to pass vars in the
: ()'s? stats;
: and not
: stats::sub($var1, $var2, etc....);

        Yes. I showed an example in the "Need help with making a
Modules" thread.


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