Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!decwrl!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.lang.perl Subject: Re: perldb changes (or bug in manual) Keywords: perldb.pl do require Message-ID: <1990Aug26.190627.21756@iwarp.intel.com> Date: 26 Aug 90 19:06:27 GMT References: <1990Aug26.055821.22669@tc.fluke.COM> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 66 In-Reply-To: dcd@tc.fluke.COM (David Dyck) In article <1990Aug26.055821.22669@tc.fluke.COM>, dcd@tc (David Dyck) writes: | 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. Correct. | 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? So you don't get unexpected behavior from "system" software when you have a getopts.pl in one of your directories. Both 'do' and 'require' use the same logic while looking for the file. Only the directories in @INC are searched, and there's no longer an implied check of the current directory ahead of the @INC list. '.' is now an explicit entry at the *end* of the list. | 2) Are the manual and comments in perldb.pl wrong? Yes. I already noticed this in "the book", and Larry is updating the manpage. (Larry, I also object to 'loading custom ...' because even the standard one says that! :-) | 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? Sounds like something Larry can change for the next patch. Right Larry? What does this break? | PS. | perl patch 28 has not appeared in comp.lang.perl here in the | northwest. I was able to get a copy from Larry's patch server. | (thanks) Well, it made it to *this* part of the Northwest (the south-Northwest :-). 'course, I'm on the Internet and get my articles an average of 15 minutes from when they were posted, but that shouldn't make *that* much difference.... # totally overlooked new feature for obscure JAPHs follows... whee!... # actually, I think Larry put this in just for good obscure coding. :-) print unpack("u","92G5S=\"!A;F]T:&5R(%!E