in reply to Simple Module Tutorial
Thanks to the writer for your trouble. But everyone seems to get it except me. I have tried to duplicate your results.
I have:
- MyScript.pl under /storage/username/PERL_SCRIPTS/dev
- Test.pm under /storage/username/local/perl/site/lib/Test/Test.pm (I just replaced MyModule.pm with Test.pm).
The module code is exactly the same. In MyScript.pl I have added
gives: Undefined subroutine &main::func1 called at MyScript.pl line 10use lib '/storage/username/local/perl/site/lib'; <p>and typed in the first two cases.</p> <code>perl MyScript.pl
Line 10 is:
print func1(@list),"\n";after typing "use Test;"
What am I missing here? Also, is the BEGIN command supposed to be used in the Perl script? It gives syntax errors when I try to use it.
Thanks in advance,
Gideon
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Simple Module Tutorial
by toolic (Bishop) on Mar 07, 2011 at 15:25 UTC | |
by Anonymous Monk on Mar 07, 2011 at 16:11 UTC | |
by toolic (Bishop) on Mar 07, 2011 at 16:34 UTC | |
by Anonymous Monk on Mar 07, 2011 at 16:58 UTC |
In Section
Tutorials