1 | package fred; |
2 | $var = 3.14159; # defines fred to be a package and var to be a variable in this package so that variables following this statement should be accessed by |
3 | $globalaccess = $fred::var; |
4 | Packages can be nested |
5 | package fred; |
6 | .................... |
7 | package jim; |
8 | $var = 3.14159; # and now we use syntax |
9 | $globalaccess = $fred::jim::var; |