in reply to Re: Breaking a script into smaller files
in thread Breaking a script into smaller files

No, '.' is already on the @INC list. That will look in the current working directory, which is not the same as the directory containing the script.

I agree that File::Basename::fileparse will be a little simpler in this case than File::Spec::splitpath, because it doesn't separate the volume out. So it becomes

use lib { my ($base,$path)= File::Basename::fileparse ($0); $path };
Assuming it's OK to leave off the @suffix parameter. The dirname function in that module looks like a natural, except for the enigmatic comment at the bottom: "For example, for the input file specification lib/, fileparse() considers the directory name to be lib/, while dirname() considers the directory name to be ." Huh? If I don't understand what it's doing, I can't use it.

And I still wonder if $0 contains the actual path, or just what was on the command line.

—John