so i'm trying to pump a bit of laziness into my code by learning how to make modules. my first attempt is failing miserably - and it's mostly copied right out of Camel(3ed)...
which is called with:package myMod; use strict; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(tryIt); sub tryIt { print "We did it!!\n\n"; } 1;
when i leave strict out of the module, we're cool. When i put it in we get:use myMod; BEGIN { push @ISA, "/home/jptxs"; } tryIt();
if i take out the our's but leave in the strict:/home/jptxs > perl -w getMyMod Use of reserved word "our" is deprecated at myMod.pm line 5. Bareword "our" not allowed while "strict subs" in use at myMod.pm line + 5. Unquoted string "our" may clash with future reserved word at myMod.pm +line 5. Array found where operator expected at myMod.pm line 5, at end of line (Do you need to predeclare our?) Global symbol "@ISA" requires explicit package name at myMod.pm line 5 +. Use of reserved word "our" is deprecated at myMod.pm line 6. Bareword "our" not allowed while "strict subs" in use at myMod.pm line + 6. Unquoted string "our" may clash with future reserved word at myMod.pm +line 6. Array found where operator expected at myMod.pm line 6, at end of line (Do you need to predeclare our?) Global symbol "@EXPORT" requires explicit package name at myMod.pm lin +e 6. syntax error at myMod.pm line 5, near "our @ISA " BEGIN failed--compilation aborted at getMyMod line 1.
I'm very confused...and after feeling so perl-elated reading the camel.../home/jptxs > perl -w getMyMod Global symbol "@ISA" requires explicit package name at myMod.pm line 5 +. Global symbol "@EXPORT" requires explicit package name at myMod.pm lin +e 6. Compilation failed in require at getMyMod line 1. BEGIN failed--compilation aborted at getMyMod line 1.
-- I'm a solipsist, and so is everyone else. (think about it)
In reply to my first module by jptxs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |