For example, suppose a subroutine within
navigation.pl declares a lexical
@homeport variable. Any mention of
@homeport will then be the newly introduced
lexical variable, but a fully qualified mention of
@Navigation::homeport accesses the package
variable instead.
package Navigation;
@homeport = (21.1, -157.525);
sub get_me_home {
my @homeport;
.. @homeport .. # refers to the lexical variable
.. @Navigation::homeport .. # refers to the package variable
}
.. @homeport .. # refers to the package variable