perl.j has asked for the wisdom of the Perl Monks concerning the following question:
I am writing my first module just to see if I can get it to work. It is extremely simple:
use strict; use warnings; package Example; use Exporter; @EXPORT = "$thing"; our $thing = "thing"; 1;
Then I used the module in a simpler script:
use strict; use warnings; use Mine::Package; print $thing;
I know I got the module name right. My module is located in Perl/site/lib/Mine/Example/ on my computer. So why isn't my program printing "thing"?
Thanks
UPDATE:I changed some package and folder names to make it easier on everyone. I also changed my code to look like my reply to davido. Added strictures.
--perl.j
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Writing Modules
by davido (Cardinal) on Aug 23, 2011 at 03:22 UTC | |
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 | |
Re: Writing Modules
by armstd (Friar) on Aug 23, 2011 at 06:03 UTC | |
Re: Writing Modules
by Anonymous Monk on Aug 23, 2011 at 06:15 UTC |
Back to
Seekers of Perl Wisdom