I know ,I can use Exporter and @EXPORT_OK/@EXPORT to use other module's subroutine,but how can I access other module's variable? Another question , in perl ,is there a difference between static variable and non-static variable?In other words, can I access other module's variable by both the module name and the module reference?
For example Module MyModule.pm;
package MyModule;
our $tmp=1;
sub new{
$this={};
bless $this;
return $this;
}
1;
perl file test.pl
Use MyModule;
How did I access the $tmp in test.pl? And , If I change $tmp to 2 in test.pl, what's the result if I access it in another perl file temp2.pl?