in reply to Accessing the package variables by fully qualified name

Any other advantage is there? Is it the safe mode of accessing the package variables ?

Since the variables have been exported there is no need to use the fully qualified name. The upside of using the fully qualified name is that you can see where the variable originated, the downside is that it is confusing if an unqualified name is used as well, or by accident. It is an argument against exporting variables - better for the module to provide accessor subroutines IMHO.
  • Comment on Re: Accessing the package variables by fully qualified name

Replies are listed 'Best First'.
Re^2: Accessing the package variables by fully qualified name
by Utilitarian (Vicar) on Jul 30, 2009 at 13:42 UTC
    cdarke's humble opinion is correct, the package variables should stay where they are and be accessed through getters and setters, if these are available, use them, if not, well be careful. $instance_of_package->set_named_variable("new_value"); is more readable I believe and for "class" variables Package::Name->set_class_variable("new Global"); is more legible to me than direct assignment, provided the accessors are half-way sensibly named.