Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: select(FILEHANDLE) in debugger - bug or feature? Keywords: select, debugger Message-ID: <9802@jpl-devvax.JPL.NASA.GOV> Date: 3 Oct 90 23:54:01 GMT References: <3148@unisoft.UUCP> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 21 In article <3148@unisoft.UUCP> cander@unisoft.UUCP (Charles Anderson) writes: : While debugging a script using the perl debugger, I noticed that : sometimes I could print variables (print $foo) and other times I : couldn't. Further investigation showed that after issuing a : "select(FILEHANDLE)" in the script under debug, printing variables : failed. I discovered that "print STDOUT $foo" works after the select. : Now, is this a bug or feature of the debugger that it doesn't notice : that default output file handle has changed? I would argue that it's : a bug and it's a pain to have to include STDOUT in every print command. This is why there's a "p" command. You shouldn't be depending on STDOUT for debugging output anyway, since it might be redirected somewhere. The "p" command prints to DB'OUT, which is opened on /dev/tty. It's only accidental that "print" happens to work, because the debugger executes an unrecognized command as a Perl statement. And Perl lets you select your default filehandle for the print statement. If your reflexes cause you to type "print" when you really want "p", then alias "print" to "p". Larry