Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!csn!cherokee!flash!rampson From: rampson@flash (Michael T. Rampson) Newsgroups: comp.lang.perl Subject: nested requires, name-space override Message-ID: <1991May22.193037.12166@cherokee.uswest.com> Date: 22 May 91 19:30:37 GMT Sender: news@cherokee.uswest.com (Telegraph Row) Reply-To: rampson@flash (Michael T. Rampson) Organization: U S WEST Lines: 47 Nntp-Posting-Host: flash.uswest.com Howdy, I was wondering if you are suppose to be able to do nested requires. I haven't been able to get them to work ("I get Can't locate dodat.pl in @INC at do_this.pl line 1."). What I'm trying to do is create an abstract interface of things you have to do to handle different types of program builders (ie., make, gmake, imake, mkmf, etc). Originally I found that there was some invariant code (ie., code that did not depend on what type of make you were using), and some code that was very specific to the MAKER that you were using. But after thinking about it, what I would really like to do is be able to override a function defined in the default library (default being things to do with make), with a function that is specific to the MAKER needed (that would be in another library). The reason I'm splitting this stuff out is so that you don't end up basically the same code replicated all over the place. Below is an example of what I would like to be able to do. require 'maker.pl'; &make(blah, blah, target) || die "a horrible death:$!"; maker.pl would look like this package maker; eval require $ENV{'MAKER'}.pl; sub main'make { local(blah,blah,$target)=@_; 'make $target'; if ($?) { warn "make died:$!"; return(0); } return(1); } 1; an example MAKER.pl would look something like the above only redefine main'make to do whatever is needed for this particular kind of MAKER. Any ideas? __ The objective of all dedicated employees should be to thoroughly analyze all situations, anticipate all problems prior to their occurrence, have answers for these problems, and move swiftly to solve these problems when called upon. However, When you are up to your ass in alligators it is difficult to remind yourself your initial objective was to drain the swamp. rampson@uswat