P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi all.
I was recently experimenting with a few perl related topics and I felt as though I might benefit from some clarification. In the following code sample:
The output seems to indicate that a lexical variable (i.e. $var) is not associated with package level scope. I was able, however, to display the value of $var (15) by omitting the name of the initial package (Test). Only after using the package level 'qualifier' (our) was I able to obtain the value $var by prepending the package name. Furthermore, there doesn't appear to be any safeguard that will prevent an interloper from creating subroutines within the namespace of neighboring (or distant) packages. Any feedback on these issues would be appreciated. Thanks, -Katie In reply to Packages, scope, and lexical variables by DigitalKitty
|
|