"be consistent" | |
PerlMonks |
Re: using "require" problemby Discipulus (Canon) |
on Sep 26, 2017 at 07:58 UTC ( [id://1200090]=note: print w/replies, xml ) | Need Help?? |
Hello gauss76, 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*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|