in reply to Help using self-made but very simple Module
Add use Exporter; at the top of your module. I.e. (simplified):
# your module ScriptUpdate.pm package ScriptUpdate; use Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(script_stats); sub script_stats { print "script_stats(): ...\n"; } 1; # the main program: #!/usr/bin/perl use lib "./Modules"; use ScriptUpdate; script_stats();
Note that our @ISA = qw(Exporter); does not load Exporter.
(Alternatively, add strictures... which will indirectly have the same effect, i.e. loading Exporter as a side effect under the hood... :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help using self-made but very simple Module
by kdmurphy001 (Sexton) on Oct 12, 2009 at 14:56 UTC | |
by almut (Canon) on Oct 12, 2009 at 15:27 UTC | |
by kdmurphy001 (Sexton) on Oct 12, 2009 at 15:39 UTC |