in reply to Writing Modules
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Writing Modules
by perl.j (Pilgrim) on Aug 23, 2011 at 14:07 UTC | |
by armstd (Friar) on Aug 23, 2011 at 15:12 UTC | |
by perl.j (Pilgrim) on Aug 23, 2011 at 15:29 UTC |