That is very good at explaining what you want to know, I won't lecture
my variables, do not have a package name, If I recall Correctly.
my variables are kinda magical. kiat asked about my variables a while ago. You should read it.
The right way, the way that will work anyway,
is like so:
Foo.pl
-------
#!/usr/bin/perl
use Bar;
print $Bar::Baz;
Bar.pm
-------
package Bar;
our $Baz=42;
-------
In older version of perl5, instead of our you would do something like:
use vars qw($Bar);
$Bar=42;
You might also search this site for "Variable scope" or something like that.
Well, I hope that helps. |