in reply to use, require, do or what?
in the file "Module1.pm" and something like:use strict; package Module1; use Exporter 'import'; our @EXPORT_OK = qw(compute_value); sub compute_value { # do the computation } 1; # this is required, see perldoc perlmod
or:use strict; use Module1; my $variable1 = Module1::compute_value();
in your main script.use strict; use Module1 qw(compute_value); my $variable1 = compute_value();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: use, require, do or what?
by AKSHUN (Novice) on Jul 30, 2008 at 19:04 UTC | |
by massa (Hermit) on Jul 30, 2008 at 20:18 UTC | |
by AKSHUN (Novice) on Jul 31, 2008 at 14:13 UTC | |
by massa (Hermit) on Jul 31, 2008 at 15:37 UTC | |
by parv (Parson) on Aug 01, 2008 at 02:35 UTC | |
| |
by actualize (Monk) on Jul 30, 2008 at 19:13 UTC | |
|