John Springer <springer@scruznet.com> writes: >I have a file that just contains subroutines that I want to use with >several other programs. I've never done this before, and "require" looked a >bit easier than "use", but I could be convinced otherwise. > > I called it mysubs.pl and ended the file with '1'. > >But every time I make an edit to the main program, it tells me "can't find >mysubs.pl" until I save the edited main. I assume this has something to >do with my edited file being in a temp directory or something. What do I >do to eliminate this problem? At the moment there's not much you can do about it, except the method outlines below. The problem is that saved and unsaved scripts get executed in different ways: Saved scripts get executed as files, unsaved as "Pseudofiles" in memory. Until 5.0.7, MacPerl would before executing change the current directory to the directory the script was in, but would omit that step for pseudofiles. In 5.1.0, the directory is set even for pseudofiles, provided the window was saved at least once. >And how do I put my file into @INC, which is where it seems to need to be? You can either add search paths in the Preferences... dialog or save your file in the "lib" folder. Matthias ----- Matthias Neeracher <neeri@iis.ee.ethz.ch> http://www.iis.ee.ethz.ch/~neeri "And that's why I am going to turn this world upside down, and make of it a fire so *bright* that someone real will notice" -- Vernor Vinge, _Tatja Grimm's World_