in reply to using "require" problem
For paths that are always relative to the script's location, the core module FindBin works well:
use FindBin; require "$FindBin::Bin/routines.pl";
Update: hippo makes a good point that require will search @INC, so yet another way to make it work is with lib, as I showed here, and below. But I also agree with Discipulus' point that turning the file into a separate package might be a good idea too.
use FindBin; use lib $FindBin::Bin; require "routines.pl";
|
|---|