Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!forsight!jato!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: perldb changes (or bug in manual) Keywords: perldb.pl do require Message-ID: <9319@jpl-devvax.JPL.NASA.GOV> Date: 28 Aug 90 21:57:43 GMT References: <1990Aug26.055821.22669@tc.fluke.COM> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 58 In article <1990Aug26.055821.22669@tc.fluke.COM> dcd@tc.fluke.COM (David Dyck) writes: : The perl manual states: : : If you want to modify the debugger, copy perldb.pl from the : perl library to your current directory and modify it as : necessary. : : The source file perldb.pl states: : # .... It also inserts a do 'perldb.pl' before the first line. : : In perl PL18 I could load a custom perldb.pl script : in the current directory, and it would get used when : invoking 'perl -d'; : : In PL28 this feature is no longer enabled, and perl : (by default) looks in the 'standard library places'. : I can use the -I . to cause it to look in the current directory. : : The sources indicate that PL28 looks for 'perldb.pl' with 'require', and : PL18 looked with 'do'. : : 1) Why doesn't 'require' look in the current directory first? Two reasons. First, you don't want things behaving funny just because you happened to cd into the wrong directory. Second, most requires will end up getting stuff out of the perl library, and your scripts will start up considerably faster if it looks there first. For a normal require, if you want it to look in the current directory first, put unshift(@INC,pop(@INC)); For a special perldb.pl, you'll have to say perl -dI . script : 2) Are the manual and comments in perldb.pl wrong? Yes. : 3) The reason I wanted to customize the library is I run under SunOS : using "on -i hostname" a lot, and the following perldb.pl lines : fail: : : open(IN,"/dev/tty"); # so we don't dingle stdin : open(OUT,">/dev/tty"); # so we don't dongle stdout : : If these line were change to the following I would not : need to do this customization. : : open(IN,"/dev/tty") || open(IN,"<&STDIN"); # so we don't dingle stdin : open(OUT,">/dev/tty") || open(OUT,">&STDOUT"); # so we don't dongle stdout : : Does anyone see anything wrong with making this change? No. In fact, I just changed my copy to do that. Larry