in reply to using "require" problem
Normally you will put your routines into a module: Routines.pm will be the name of the file with inside a package called Routines You can use Exporter to export, possibly just on demand, one or more subs.
Consider also that current directory . is no more included in @INC in newer Perl version for security reasons: you can include it with use lib '.'; (or adding it directly to @INC or using the -I perl switch) PS this is probably unrelated (see below) but important to know anyway
Look at my homenode for many links about modules and code reuse: especially require "shared.pl" with use strict; and Include subs from different perl file
L*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using "require" problem
by haukex (Archbishop) on Sep 26, 2017 at 08:03 UTC |