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

I've used File::Basename for a similar purpose--I think __FILE__ is probably more appropriate than $0, though. I'm guessing that either

use lib dirname __FILE__;
or the push @INC variant of the same thing would work.

I don't think $0 is appropriate because if memory serves it only contains the base name of the file if the script is invoked that way (for instance if it's in the user's PATH somewhere). Though I could be totally wrong about that :-)



If God had meant us to fly, he would *never* have given us the railroads.
    --Michael Flanders