I'm writing a fragment of perl which is being included by the main perl program elsewhere.
I want to split it into a few files for maintenance purposes, and include each of those from my "top level" fragment.
The problem is that if I do
use "first_stuff.pl";
use "second_stuff.pl";
in my top leve fragment, perl isn't looking in the directory where my fragment is for first_stuff.pl and second_stuff.pl.
In fact, it appears to be looking in the directory where the main prgram is running (and presumably its also looking in the @INC directories).
What I'm grappling with is that I seem to have no way of finding out what directory my fragment is in.. if I knew that, then I could put in in @INC or prepend it explicitly to the filename for use....
Any clues?
Start Free Trial