I know I got the module name right.
Which module name? Your package is named here:
package pack;
You're invoking it with:
use mine::package;
When you get your package's name as declared with package to match the name as requested via use, and into a path within your Perl's /lib/* hierarchy that matches the name, you will find it works better.
You wouldn't say "my $this = 5;", and then "say $that;". It's a similar principle.
The next step will be in either using the fully qualified name of $thing, or exporting the variable into your caller's name-space. See perlmod, and Exporter.
Also, by general convention people usually give their modules names where the first character of each word is capitalized, as in Quantum::Superpositions, or List::Util. (but not always...). The convention is that all-lower-cased names are used for pragmas such as strict, warnings, and others.
Dave
In reply to Re: Writing Modules
by davido
in thread Writing Modules
by perl.j
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |