5.45. Perl packages and modules

发布时间 :2023-10-20 23:00:03 UTC      

Each package in Perl has a separate symbol table, which defines the syntax as follows:

package mypack;

This statement defines a file named mypack , the names of all variables and subroutines defined thereafter are stored in the symbol table associatedwith the package until another package statement.

Each symbol table has its own set of variables and subroutine names, and each group of names are irrelevant, so you can use the same variable name indifferent packages and represent different variables.

Accessing variables from one package to another can be specified by “package name + double colon (::) + variable name”.

The default symbol table for storing the names of variables and subroutines is the same as the name main is associated with the package. If you define other packages in the program, you can re-specify the main package when you want to switch back to the default symbol table:

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.