Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Simple question about namespaces

by Eily (Prior)
on Feb 27, 2014 at 16:27 UTC ( #1076418=note: print w/replies, xml ) Need Help??

in reply to Simple question about namespaces

If you have package variables in either of the two packages, the other will be able to read or write on them. For exemple you could have in : $SUBS::option = getOption(); and if you declare our $option in the package SUBS, it will be the same variable.

If neither files have a package statement, then all variables declared by our will be in package Main, a variable declared our $option in one file will be the same as our $option in the other.

If you feel that messing around with another package's variables isn't clean enough, you could write accessor subs to get and set them.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1076418]
[davido]: jdporter : Is there a specific issue, or are we all just getting up there?
thezip vouches for that, but then forgets what he was vouching for...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2018-06-21 16:46 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (118 votes). Check out past polls.