in reply to Re: About packages and scopes
in thread About packages and scopes

It is possible that i assumed it meant the program when it was the package. But wouldn't that make it lexical? I need a beginners guide to perl packages. This was from the O'reilly Programming Perl. Upon futher inspection, there are no global variables in perl, just package variables.

Replies are listed 'Best First'.
Re: Re: Re: About packages and scopes
by japhy (Canon) on Nov 19, 2001 at 22:56 UTC
    There are a handful of global variables -- punctuation ones, mostly.

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Re:{3}: About packages and scopes
by staeryatz (Monk) on Nov 19, 2001 at 23:57 UTC
    Wouldn't that make it lexical? Good question.

    The answer is no, because lexical variables expire once they are outside a certain scope, and cannot be referenced outside of that scope.

    Global package variables on the other hand, can be accessed at any time, as long as you use the package names and colons preceeding the variable name.

    Hope that clears up a few things...